登录式shell:
su – username
su -l username
非登录式shell:
su username
图形终端下打开命令窗口
自动执行的shell脚本
bash的配置文件
全局配置:
/etc/profile,/etc/proflie.d/*.sh,/etc/bashrc
个人配置:
~/.bash_profile,~/.bashrc
profiles类配置文件:
设定环境变量,运行命令或脚本
bashrc类配置文件:
设定本地变量,定义命令别名
登录式shell如何读取配置文件:
/etc/profile,/etc/profile.d/*.sh,~/.bash_profile,~/.bashrc,/etc/bashrc
非登录式shell如何读取配置文件:
~/.bashrc,/etc/bashrc,/etc/profile.d/*.sh
转载于:https://blog.51cto.com/aboboo520/1882469