以 "." 开始的文件名在各种 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)
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值