各配置文件介绍
profile
location: /etc/profile
- 设置系统级的环境变量和启动程序
- 会对所有用户生效
- 用户登录(login)时,文件会被执行,并从/etc/profile.d目录的配置文件中搜集shell的设置
修改完后用source生效:source /etc/profile
bash_profile
location:~/.bash_profile
执行顺序
/etc/profile > ~/.bash_profile > ~/.bash_login > ~/.profile