tcsh 的環境設定

/etc/csh.cshrc

/etc/csh.login

$HOME/.tcshrc ( 若不存在則執行 $HOME/.cshrc )

$HOME/.login    

 

Dears

 

因用國信的shell 每個人設定不太一樣,整理了一些shell,大家可以改成自已比較習慣的。

 

 

Bash 的環境設定

/etc/profile (主要)

$HOME/.bash_profile (主要)

$HOME/.bash_login

$HOME/.profile

$HOME/.bash_logout (主要)

$HOME/.bashrc (主要)

/etc/bashrc

 

登入(login)時

先執行 /etc/profile

接著bash會檢查使用者的自家目錄中,

是否有 .bash_profile

或者   .bash_login

或者   .profile,

若有,則會執行其中一個,執行順序為:

.bash_profile 最優先

.bash_login其次

.profile 最後

 

 

 

不管你的Login Shell 是那一種shell,每一個shell都有它自己的 Start Files ,

我們設定理想環境時所需使用的指令與變數的設定,都可 以寫在這些 Start Files中,

在login 時就加以執行或設定,這些 Start Files 的名稱分別是:

 

SHELLs           Start Files

───            ──────

sh               /etc/profile

                $HOME/.profile

 

bash         /etc/profile

                $HOME/.profile(or $HOME/.bashrc)

 

csh             None

                  $HOME/.cshrc & $HOME/.login

 

tcsh          None

                $HOME/.cshrc(or $HOME/.tcshrc)

                & $HOME/.login

                              

如果這些檔案都存在,那麼它們的執行順序將是:

sh系列

/etc/profile --> $HOME/.profile

 

csh系列

$HOME/.cshrc --> $HOME/.login

arrow
arrow
    全站熱搜

    飛天!! 發表在 痞客邦 留言(0) 人氣()