| 文件 | 作用范围 | 说明 |
|---|---|---|
/etc/environment | 系统全局 | 系统级环境变量,所有用户生效 |
/etc/profile | 系统全局 | 登录Shell时执行 |
/etc/profile.d/*.sh | 系统全局 | 登录Shell时执行的脚本目录 |
/etc/bash.bashrc | 系统全局 | 交互式非登录Shell |
~/.bash_profile | 当前用户 | 登录Shell时执行(优先级1) |
~/.bash_login | 当前用户 | 登录Shell时执行(优先级2) |
~/.profile | 当前用户 | 登录Shell时执行(优先级3) |
~/.bashrc | 当前用户 | 交互式非登录Shell |