Reload .bash_profile without logging in again
If you have updated your .bash_profile you may want to reload the latest changes into your current shell & avoid logging out and back in.
The .bash_profile is actually an executable bash script. To reload it we need to load & execute it in the current shell. We can do that using the command source
At the prompt enter:
source ~/.bash_profileThis will load & execute the ~/.bash_profile file in the current shell.
Using an Alias
If you find yourself needing to do this often, you can create an alias to do this using a custom command, for example reload.
Add the following line to your .bash_profile or .bash_aliases file:
alias reload='source $HOME/.bash_profileAfter running source ~/.bash_profile the command reload will be available to.
🐢
Yes, you'll need to reload your
.bash_profile for this change to take effect!