[ 永远的UNIX::UNIX技术资料的宝库 ]

首页 > 系统管理 > 其它 > 正文
以 "." 开始的文件名在各种 shell 中的用途
Steve Hayman (2001-04-19 11:03:22)
  下面的说明或许不尽完整,但应该讲的都讲了。 

csh 
  有一些版本在系统中所有使用者都必须读取的 .cshrc 与 .login。不 
  过,每一个版本放置这些档案的地方不大相同。 

    启动 (依照所列顺序): 
        .cshrc   - 每次都会读取 
        .login   - login shell 才会读取 

    结束之前: 
        .logout  - login shells. 

    其他: 
        .history - 储存history (根据 $savehist 的值决定大小). 

tcsh 
    启动 (依照所列顺序): 
        /etc/csh.cshrc - 每次都会读取 
        /etc/csh.login - login shells 才会读取 
        .tcshrc        - 每次都会读取 
        .cshrc         - 假如没有 .tcshrc 在的话 
        .login         - login shells 才会读取 

    结束之前: 
        .logout        - login shells 才会读取. 

    其他: 
        .history       - saves the history (based on $savehist). 
        .cshdirs       - saves the directory stack. 

sh 
    启动 (依照所列顺序): 
        /etc/profile - login shell 才会读取 
        .profile     - login shell 才会读取 

    结束之前: 
        any command (or script) specified using the command: 
           trap "command" 0 

ksh 
    启动 (依照所列顺序): 
        /etc/profile - login shells 才会读取 
        .profile     - login shells 才会读取 
        $ENV         - always, if it is set. 

    结束之前: 
        如果你用了 trap "command" 0,则结束之际会执行 "command" ( 

bash 
    启动 (依照所列顺序): 
        /etc/profile  - login shell 才会读取 
        .bash_profile - login shell 才会读取 
        .profile      - 如果没有 .bash_profile,则会在 login 时读取 
        .bashrc       - interactive non-login shell 才会读取 
        $ENV          - 若有设定则读取之 

    结束之前: 
        .bash_logout  - login shell 读取之 

    其他: 
        .inputrc      - Readline 初始化之时 
zsh 
    启动 (依照所列顺序): 
        .zshenv - 若无 -f  就会读取 
        .zprofile - login shell 呕岫寥?nbsp;
        .zshrc    - interactive shell 若无 -f  就会读取 
        .zlogin   - login shell 结束之前 

    结束之前: 
        .zlogout  - login shell 才会读取 

rc 
    启动 (依照所列顺序): 
        .rcrc - login shell 才会读取  (http://www.fanqiang.com)
    进入【UNIX论坛

相关文章

===更多相关===
 

★  樊强制作 欢迎分享  ★