站在用户登录的角度看待shell的类型:
登录式shell
1 正常登录
2 su - username
3 su -l username
非登录式shell
1 su username
2 自动执行的shell脚本
全局配置文件
/etc/profile
/etc/profile.d/*.sh
/etc/bashrc
局部配置文件
~/.bash_profile
~/.bashrc
profile类的配置文件:
1 配置全局环境变量
2 一登录执行的命令或脚本
bash类的配置文件:
1 配置本地变量
2 定义命令别名
登录式shell加载配置文件的顺序:
/etc/profile
/etc/profile.d/*.sh
~/.bash_profile
~/.bashrc
/etc/bashrc
非登录式shell加载配置文件的顺序:
~/.bashrc
~/.bash_profile
/etc/profile.d/*.sh
登录式shell
1 正常登录
2 su - username
3 su -l username
非登录式shell
1 su username
2 自动执行的shell脚本
bash配置文件:
全局配置文件
/etc/profile
/etc/profile.d/*.sh
/etc/bashrc
局部配置文件
~/.bash_profile
~/.bashrc
profile类的配置文件:
1 配置全局环境变量
2 一登录执行的命令或脚本
bash类的配置文件:
1 配置本地变量
2 定义命令别名
登录式shell加载配置文件的顺序:
/etc/profile
/etc/profile.d/*.sh
~/.bash_profile
~/.bashrc
/etc/bashrc
非登录式shell加载配置文件的顺序:
~/.bashrc
~/.bash_profile
/etc/profile.d/*.sh
本文详细介绍了Linux系统中shell的两种主要类型——登录式shell与非登录式shell,并阐述了不同类型的shell加载配置文件的顺序。同时,还解释了全局配置文件与局部配置文件的区别,帮助读者更好地理解shell配置的工作原理。
1100

被折叠的 条评论
为什么被折叠?



