一、登录类型
1、交互式登录
直接通过终端输入账号和密码登录
使用 su -l USERNAME 或 su - USERNAME
2、非交互式登录
su USERNAME
图形界面下打开的终端
执行脚本
二、bash的配置文件
1、profile类:为交互式登录的用户提供配置
全局:
/etc/profile
/etc/profile.d/*.sh
用户:
~/.bash_profile
功用:
设定环境变量
运行命令或脚本
2、bashrc类:为非交互式登录的用户提供配置
全局:
/etc/bashrc
用户:
~/.bashrc
功用:
设定本地变量
定义命令别名
三、配置文件生效过程
1、交互式登录:
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
2、非交互式登录:
~/.bashrc --> /etc/bashrc --> /etc/profile.d/*.sh
转载于:https://blog.51cto.com/princepar/1652707

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



