Linux shell系統下執行export及使用man bash

來源:互聯網
上載者:User

給大家推薦一款很不錯的Linux shell系統很有學習價值,這裡我主要講解Linux shell系統的應用,包括介紹Linux shell知識等方面。

一、在Linux shell下,執行export:

declare -x LANG="en_US"這個LANE環境變數,就是我們希望去修改的,但是在哪裡修改,比較合適呢?

二、Linux shell使用man bash:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands  from  the file /etc/profile, if that file exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and  ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.  The --noprofile option may be used when the shell is started to inhibit this behavior.

即bash在登入時,會依次讀取這些設定檔:

 
  1. /etc/profile  
  2. /.bash_profile  
  3. /.bash_login  
  4. /.profile 

三、對於Linux shell的預設語言

應該在系統級的檔案中(/etc/profile)修改,以便修改的結果可以被每一個使用者繼承:開啟/etc/profile,直接在其上,找不到關於LANG變數的設定命令,但細心觀察,該指令碼還執行了其他指令碼:for i in /etc/profile.d/*.sh ; doif [ -r "$i" ]; then . $i fi done

四、到/etc/profile.d/目錄下,查看這些*.sh的指令碼,發現了一個名為"lang.sh"的檔案,應該就是它了:

開啟/etc/profile.d/lang.sh,開頭幾句:for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do[ -f $langfile ] && . $langfile && sourced=1done這個/etc/sysconfig/i18n,就是設定系統預設語言的地方,對於我的系統,現在它的內容如下:

 
  1. LANG="en_US" 
  2. SUPPORTED="en_US:en" 
  3. SYSFONT="lat0-sun16" 
  4. SYSFONTACM="iso01" 

如果,你希望系統的預設語言變更為UTF-8,可以把LANG修改為:LANG="en_US.UTF-8"

  1. 深度淺析種類模式Linux shell編程
  2. 暢談簡介Linux shell核心傳遞命令
  3. 完全講解終級Linux shell命令模式
  4. 全面分析討論Linux Shell編程
  5. 簡要介紹Linux shell命令的收集程式設計語言

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.