/etc/profile和/etc/bashrc(bash.bashrc)(转)

(1)/etc/profile 登录时,会执行。
全局(公有)配置,不管是哪个用户,登录时都会读取该文件。
(2)/ect/bashrc Ubuntu没有此文件,与之对应的是/ect/bash.bashrc
bash.bashrc 是交互式shell的初始化文件。
(3)~/.profile 某个用户读取的配置。
若bash是以login方式执行时,读取~/.bash_profile,若它不存在,则读取~/.bash_login,若前两者不存在,读取~ /.profile。
另外,图形模式登录时,此文件将被读取,即使存在~/.bash_profile和~/.bash_login。
(4)~/.bash_login
若bash是以login方式执行时,读取~/.bash_profile,若它不存在,则读取~/.bash_login,若前两者不存在,读取~ /.profile。
(5)~/.bash_profile Unbutu默认没有此文件,可新建。
只有bash是以login形式执行时,才会读取此文件。通常该配置文件还会配置成去读取~/.bashrc。
(6)~/.bashrc 该文件包含专用于某个用户的bash shell的bash信息,当该用户登录时以及每次打开新的shell时,该文件被读取.
当bash是以non-login形式执行时,读取此文件。若是以login形式执行,则不会读取此文件。
(7)~/.bash_logout
注销时,且是longin形式,此文件才会读取。也就是说,在文本模式注销时,此文件会被读取,图形模式注销时,此文件不会被读取。

posted on 2015-03-27 10:21  hi_rain  阅读(168)  评论(0)    收藏  举报