各环境变量的区别 | ||
变量 | 作用范围 | 生效方式 |
/etc/profile | 所有用户环境, 包括设置 shell (bash, sh, zsh 之类) 及各应用程序的运行环境 |
重启系统或注销用户重新登录 |
/etc/bashrc | 所有用户的 bash shell 环境 | 每次打开一个 bash shell |
~/.bash_profile | 当前登录用户的 bash shell 环境, 并执行当前用户的 .bashrc 文件 |
各环境变量的区别 | ||
变量 | 作用范围 | 生效方式 |
/etc/profile | 所有用户环境, 包括设置 shell (bash, sh, zsh 之类) 及各应用程序的运行环境 |
重启系统或注销用户重新登录 |
/etc/bashrc | 所有用户的 bash shell 环境 | 每次打开一个 bash shell |
~/.bash_profile | 当前登录用户的 bash shell 环境, 并执行当前用户的 .bashrc 文件 |