命令行中的配置文件?

如何从命令行重新加载.bash_profile ? 通过退出并重新登录,我可以让shell识别对.bash_profile所做的更改,但我希望能够按需执行此操作。


只需输入source ~/.bash_profile

另外,如果你喜欢保存击键,你可以输入. ~/.bash_profile . ~/.bash_profile


. ~/.bash_profile

只要确保你没有任何对当前状态的依赖。


只需输入:

. ~/.bash_profile

但是,如果您想要在终端启动时自动运行它,而不是在每次打开终端时运行它,则可以添加. ~/.bash_profile . ~/.bash_profile~/.bashrc文件。

注意:

当你打开一个终端时,终端会以(非登录)交互模式开始bash,这意味着它将发送~/.bashrc

~/.bash_profile仅在交互式登录模式下启动时才由bash提供。 通常只有当您在控制台(Ctrl + Alt + F1..F6)登录时,或者通过ssh连接时。

链接地址: http://www.djcxy.com/p/4315.html

上一篇: profile from the command line?

下一篇: key to use when executing shell command?