How to Reload bash_profile, zsh profiles from 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.
Refresh bash_profile from the users home directory:
Refresh zsh profile from the users home directory:
Reloading and refreshing other command line shell profiles, tcsh, fish, etc is just a matter of pointing source at the initialization script like so:
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.