Login shell
- 登录命令
su - USERNAME
su
Non-Login Shell
- 登录命令
su
- 图形界面下打开命令终端
- 自动执行的shell脚本
bash配置文件
- 全局配置文件
/etc/profile
/etc/profile.d/*.sh
/etc/bashrc
- 用户配置文件
~/.bsah_profile
~/.bashrc
- profile类的文件一般用途
设定环境变量
运行命令或脚本 - bashrc类的文件一般用途
设定本地变量
定义命令别名
用户登录时加载bash配置文件的顺序
- Login Shell
1 /etc/profile
2 /etc/profile.d/*.sh
3 ~/.bash_profile
4 ~/.bashrc
5 /etc/bashrc - Non Login Shell
1 ~/.bashrc
2 /etc/bashrc
3 /etc/profile.d/*.sh