DEV Community

taijidude
taijidude

Posted on • Edited on

1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay