我可以重新加载顺序http://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/用source,但有一个短的路?
我的意思是,一个命令按顺序加载所有文件,而不是:
source /etc/profile
source ~/.bash_profile
source ~/.bashrc
source ~/.bash_login
source ~/.profile
Run Code Online (Sandbox Code Playgroud)
它可能不是最好的,但这里有一个快速的方法来资源一切:
exec bash -l
Run Code Online (Sandbox Code Playgroud)
该-l部队的bash作为一个登录shell,这应该source/etc/profile文件的工作.
把这个放在你的 ~/.bashrc
rld() {
source /etc/profile
source ~/.bash_profile
source ~/.bashrc
source ~/.bash_login
source ~/.profile
}
Run Code Online (Sandbox Code Playgroud)
现在,您可以rld随时重新加载所有这些文件。