~/.bash_profile or ~./bash_login (官网:~/.bash_profile or ~./bash_login - If one of these file exist, bash executes it rather then "~/.profile" when it is started as a login shell. (Bash will prefer "~/.bash_profile" to "~/.bash_login"). However, these files won‘t influence a graphical session by default.)
~/.pam_environment:用户级的环境变量设置文件,没有做测试,不知道管不管用。
环境变量的配置
系统级环境变量的设置【对所有用户生效(永久的)】
# vi /etc/profile
export PATH=$PATH:/path/to/xxx
# source /etc/profile
用户级环境变量的设置【对单一用户生效(永久的)】
# vi /home/用户名/.bash_profile
export PATH=$PATH:/path/to/xxx