0

我可以按以下顺序重新加载它们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
4

2 回答 2

7

它可能不是最好的,但这里有一个快速获取所有资源的方法:

exec bash -l

-l强制 bash 作为登录 shell 工作,它应该来自 /etc/profile 。

于 2012-07-27T08:37:47.113 回答
5

把这个放在你的~/.bashrc

rld() {
  source /etc/profile
  source ~/.bash_profile
  source ~/.bashrc
  source ~/.bash_login
  source ~/.profile
}

现在,您可以rld随时重新加载所有这些文件。

于 2012-07-27T08:50:32.223 回答