1. 程式人生 > >Linux bash篇(二 操作環境)

Linux bash篇(二 操作環境)

1.命令執行的順序

(1).相對/絕對路徑

(2).由alias找到的命令

(3).由bash內建的命令 

(4).通過$PATH變數找到的第一個命令

2.第一篇講到的bash在登出後就會無效,如果想保留需要寫在配製檔案裡面

3.取得bash有兩種方式,登入和不登入(login shell 和 non-login shell)

4.通過login shell取得的配製檔案資料:

/etc/profile            系統整體配製檔案,最好不要修改

~/.bash_profile   ~/.bash_login  ~/.profile。 使用者個人配製資料檔案

5.

/etc/profile又會呼叫

/etc/inputrc

/etc/profile.d/*.sh       只要使用者具有 r 的許可權並且檔案字尾名為 .sh 的檔案就會被/etc/profile呼叫

                             注意:如果想要為所有使用者設定共享的配製時,就需要/etc/profile.d目錄裡配製

/etc/sysconfig/i88n   由/etc/profile.d/lang.sh呼叫,主要設定語言

~/.bash_profile        login shell後才會讀

 

6.讀入環境配製檔案(不必登出)     source

  eg:把使用者目錄下的.bashrc檔案讀入到目前的bash環境中

  source ~/.bashrc

 

7.檢視目前終端機的按鍵內容   stty -a