shell配置脚本
├ /etc/profile --->/etc/profile.d/*.sh
└ ~user/.bash_profile
└ ~user/.bashrc
└ /etc/bashrc
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该
文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该
该文件被读取.
~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件.
来源:http://linux.chinaunix.net/bbs/viewthread.php?tid=888318
执行顺序为:/etc/profile -> (~/.bash_profile | ~/.bash_login | ~/.profile) -> ~/.bashrc -> /etc/bashrc -> ~/.bash_logout
来源:http://blog.csdn.net/lllxy/archive/2008/08/22/2814633.aspx
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22383153/viewspace-672301/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22383153/viewspace-672301/