启动顺序:
首先启动 /etc/profile(适用于所有shell), 再启动 ~/.bash_profile,~/.bash_login或者~/.profile一个
如果~/.bash_profile 存在,则会启动~/.bashrc系统级文件
/etc/profile 系统级环境变量,修改后重启系统生效,export PATH=”$PATH:your path1:your path2 ...” ,冒号隔开。
/etc/enviroment 登录时使用的第二个文件,修改后重启生效,PATH="<......>:your path1:your path2 …" ,这里添加的是 PATH ,不是export PATH,冒号。
/etc/bash.bashrc: 系统bahsrc文件。用户级文件
~/.profile:用户主目录下(针对当前用户),注销再登录
~/.bashrc: 当前用户, 注销后登录。
~/.bash_profile
~/.bash_login
~/.bash_logout
~/.pam_enviroment
只对当前窗口有效
/root/.profile
~/.profile(/home/whubob/.bashrc)
系统启动生效,设置用户环境变量
/root/.bashrc
~/.bahsrc(/home/whubob/.bashrc)