有没有办法通过bash_profile“资源”而无需重启终端?

时间:2016-07-11 00:53:30

标签: bash .bash-profile

我经常需要对~/.bash_profile进行更改,我必须重新启动终端才能传播更改。我可以运行任何命令来重新发送~/.bash_profile吗?

1 个答案:

答案 0 :(得分:7)

是的,您可以运行:

source ~/.bash_profile

或者:

. ~/.bash_profile

这将重新加载/重新获取当前shell中的.bash_profile

为方便起见,我将此命令放在~/.bash_profile中:

alias reprofile='source ~/.bash_profile'

然后我只需输入reprofilerepro TAB