有没有办法在不重启终端的情况下通过 bash_profile "resource"?

Is there a way to "resource" by bash_profile without restarting terminal?

我经常需要对我的 ~/.bash_profile 进行更改,并且我必须重新启动终端才能传播更改。有什么命令可以 运行 重新获取我的 ~/.bash_profile?

是的,你可以 运行:

source ~/.bash_profile

或:

. ~/.bash_profile

这将 reload/re-source 当前 shell 中的 .bash_profile

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

alias reprofile='source ~/.bash_profile'

然后我只需输入 reprofilerepro TAB.