问题
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
?
回答1:
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.
来源:https://stackoverflow.com/questions/38297774/is-there-a-way-to-resource-by-bash-profile-without-restarting-terminal