有没有一种方法可以在不重启终端的情况下通过bash_profile进行资源管理?

9 浏览
0 Comments

有没有一种方法可以在不重启终端的情况下通过bash_profile进行资源管理?

这个问题已经有答案了:

如何在命令行中重新加载.bash_profile

我经常需要对我的~/.bash_profile进行更改,然后我必须重新启动终端才能使更改生效。是否有任何命令可以重新加载我的~/.bash_profile?

admin 更改状态以发布 2023年5月23日
0
0 Comments

是的,你可以直接运行:

source ~/.bash_profile

或者:

. ~/.bash_profile

这将重新加载/重新源代码当前shell中的.bash_profile

我为了方便将此命令放在了我的~/.bash_profile中:

alias reprofile='source ~/.bash_profile'

然后我只需要输入reprofilereproTAB

0