使环境变量永久化

时间:2011-03-22 07:31:33

标签: shell export

shell> export HISTTIMEFORMAT='%F %T '
shell> history | tail -n 2
 1006  2010-01-16 00:55:47  export HISTTIMEFORMAT='%F %T '
 1007  2010-01-16 00:55:49 history | tail -n 2

只要设置了环境变量,这将持续,因此如果我注销,则需要再次设置它。我如何使这个永久性?

1 个答案:

答案 0 :(得分:3)

将其添加到您的~/.bashrc~/.bash_profile - 其中一个将在bash启动时读取。登录时会读取.bash_profile,当您创建新的交互式非登录shell(例如从X打开终端窗口)时会读取.bashrc

相关问题