Centos6 系统配置文件 /etc/profile, ~/.bash_profile 等区别

 

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

               在登录Linux时执行文件的过程如下:

               执行顺序为:/etc/profile -> ~/.bash_profile -> ~/.bashrc -> /etc/bashrc -> ~/.bash_logout

 

Centos6 系统配置文件 /etc/profile, ~/.bash_profile 等区别_第1张图片

 

 

 

 

 

 

 

 

你可能感兴趣的:(Centos6)