1、login shell 和non-login shell
顾名思义,login shell就是要输入用户名和密码才能启动的shell,non-login shell不需要重复登录就能启动shell。
2、login shell环境配置文件
/etc/profile: 系统整体的配置文件,对所有登录的用户有效。
/etc/profile会调用的配置文件:
/etc/inputrc:设置热键等信息;
/etc/profile.d/*.sh: 操作界面、语言习惯、公共命令的别名等;
/etc/sysconfig/i18n: /etc/profile.d/*.sh调用,配置语系。
~/.bash_profile: 个人配置文件
~/.bash_login: 个人配置文件
~/.profile: 个人配置文件
扫描二维码关注公众号,回复:
1031380 查看本文章
优先级:~/.bash_profile>~/.bash_login>~/.profile
如果~/.bashrc存在: ~/.bash_profile-->~/.bashrc-->~/.bashrc-->/etc/bashrc-->/etc/profile.d/*.sh-->/etc/sysconfig/i18n
3、non-login shell 环境配置
配置~/.bashrc
调用顺序:~/.bashrc-->~/.bashrc-->/etc/bashrc-->/etc/profile.d/*.sh-->/etc/sysconfig/i18n