refresh profile command linerefresh profile command line

For anyone making customizations to their command line appearance, prompt, adding aliases, a new PATH, setting environment variables, or otherwise changing their bash_profile, bashrc, zshrc, and related shell profiles, it’s helpful to know how to quickly reload the profile.

Many users simply launch a new shell or open a new terminal window, but there is no need to do that, there’s a way to directly refresh the profile in use thanks to the source command.

Reload .bash_profile Bash Profile

Refresh bash_profile from the users home directory:
source .bash_profile

Reload .zshrc ZSH Profile

Refresh zsh profile from the users home directory:
source ~/.zshrc

Reloading and refreshing other command line shell profiles, tcsh, fish, etc is just a matter of pointing source at the initialization script like so:

source ~/.profile

source ~/.tcshrc

This is much easier and faster than launching a new shell, give it a try the next time you’re making adjustments to your command line initialization files.

And yes this works in Mac OS X Terminal as well as linux.

Source

Follow Me:
Top Best Sellers!!