交互式登陆shell 对于交互式的登陆shell而言,CentOS规定了startup文件的加载顺序如下: 登陆过程: 1. 读取并执行/etc/profile文件: 2. 读取并执行~/.bash_profile文件: - 若文件不存在,则读取并执行~/.bash_login文件: - 若文件不存在,则读取并执行~/.profile文件: 登出过程: 1. 读取并执行~/.bash_logout文件: 2. 读取并执行/etc/bash.bash_logout文件: .zshrc   sour…
关于登录linux时,/etc/profile.~/.bash_profile等几个文件的执行过程. 在登录Linux时要执行文件的过程如下: 在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile. ~/.bash_login或 ~/.profile文件中的其中一个,执行的顺序为:~/.bash_profile. ~/.bash_login. ~/.profile.如果 ~/.bash_profile文件存在的话,一般还会执行 ~…
profile bashrc bash_profile之间的区别和联系 博客分类: Linux   执行顺序为:/etc/profile -> (~/.bash_profile | ~/.bash_login | ~/.profile) -> ~/.bashrc -> /etc/bashrc -> ~/.bash_logout 关于各个文件的作用域,在网上找到了以下说明: (1)/etc/profile: 此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/…
profile,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part 2   by:授客 QQ:1033553122 --------------------接Part 1------------------- B.   当bash以interactive shell方式启动时: 如果存在~/.bashrc,bash从~/.bashrc中读取命令并执行 注意: 1.通过--rcfile  file选项可强制ba…
分类: linux 2015-03-13 16:24 1572人阅读 评论(0) 收藏 举报linuxprofile关于登录linux时,/etc/profile.~/.bash_profile等几个文件的执行过程. 在登录Linux时要执行文件的过程如下: 在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile. ~/.bash_login或 ~/.profile文件中的其中一个,执行的顺序为:~/.bash_profile. ~…
/etc/profile.~/.bash_profile等几个文件的执行过程  摘自:http://blog.chinaunix.net/uid-14735472-id-3190130.html 分类: LINUX 2012-04-26 17:44:55   http://blog.chinaunix.net/uid-346158-id-2130833.html 关于登录linux时,/etc/profile.~/.bash_profile等几个文件的执行过程. 在登录Linux时要执行文件的过…
来自: profile.bash_profile.bashrc文件的作用与区别 1. profile 文件 1.1 profile 文件的作用 profile(/etc/profile),用于设置系统级的环境变量和启动程序,在这个文件下配置会对所有用户生效.当用户登录(login)时,文件会被执行,并从/etc/profile.d目录的配置文件中查找 shell 设置. 1.2 在profile中添加环境变量 一般不建议在/etc/profile文件中添加环境变量,因为在这个文件中添加的设置会对…
profile(/etc/profile)和bash_profile的区别 profile(/etc/profile),用于设置系统级的环境变量和启动程序,在这个文件下配置会对所有用户生效.当用户登录(login)时,文件会被执行,并从/etc/profile.d目录的配置文件中查找shell设置. 一般不建议在/etc/profile文件中添加环境变量,因为在这个文件中添加的设置会对所有用户起作用. bash_profile只有单一用户有效,文件存储位于~/.bash_profile,该文件是…
/etc/profile是全局的,是私有的 /etc/profile用于整个系统所有用户, ~/.bash_profile, ~/.profile和~/.bashrc 用于各个用户,这里的"~"符号就是各当前用户的$HOME ~/.bash_profile 和 ~/.profile 只在登陆时读取一次. ~/.bashrc 每次都读取 ~/.bash_profile 和 ~/.profile 的区别在于,bash 只读取~/.bash_profile:而对于 ~/.profile 来说…
.bash_profile 开机自动加载,比如java的环境变量放在里面 .bashrc打开shell或终端就会加载该文件,比如起的别名或快捷方式放里面.alias设置就在其中. 还有一个.profile设置全局变量. 以上设置完之后,均可使用source命令立即生效: source .bash_profile source .bashrc…