[ 永遠的UNIX::UNIX技術資料的寶庫 ]   GB | BIG5

首頁 > 系統管理 > 其它 > 正文
以 "." 開始的文件名在各種 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論壇

相關文章

======
 

★  樊強制作 歡迎分享  ★