I often times have to make changes to my ~/.bash_profile
, and I have to restart terminal for the changes to propagate. Is there any command I can run to re-source my ~/.bash_profile
?
bash_profile is read and executed when Bash is invoked as an interactive login shell, while . bashrc is executed for an interactive non-login shell. Use . bash_profile to run commands that should run only once, such as customizing the $PATH environment variable .
bash_profile is used for customizing the user configuration settings. This file is located in the home directory and is mostly hidden. The . bash_profile files are considered as configuration scripts.
So, if you wanna restart the terminal, just enter rest (short for restart) in your terminal.
Yes, you can just run:
source ~/.bash_profile
Or:
. ~/.bash_profile
This will reload/re-source the .bash_profile
in the current shell.
I put this command in my ~/.bash_profile
for convenience:
alias reprofile='source ~/.bash_profile'
Then I just type reprofile
or repro
TAB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With