DEV Community

taijidude
taijidude

Posted on • Updated on

The first things i do when installing a new shell...

I love the adaptability of command line interfaces. Use both powershell and bash on windows, maybe bash a little more than the ps. Anyway i add stuff to the bash or powershell Profile Files quite often. So the first things i add are two functions(ps) or aliases(bash) when setting up new shell:

  1. A function named eprof (edit profile). This opens the profile file in an editor.
  2. A function named rprof (refresh profile). This reloads the profile for the curren sessiont without having to reopen the shell.

so how does this look?

bash

alias epr="code ~/.bashrc"
Enter fullscreen mode Exit fullscreen mode
alias rpr="source ~/.bashrc"
Enter fullscreen mode Exit fullscreen mode

powershell

function eprof {
    Set-Location 'Path to my Powershell Profile'
    code .\Microsoft.PowerShell_profile.ps1
}
Enter fullscreen mode Exit fullscreen mode
function rprof {
    . $PROFILE
}
Enter fullscreen mode Exit fullscreen mode

The code keyword opens the specific files in vs code.

Top comments (0)