Linux - 終端語言設置

查看當前終端用戶的語言設置

locale - get locale-specific information : locale |grep LANGbash

改變當前終端用戶的語言設置(臨時生效)

中文UTF-8: export LANG="zh_CN.UTF-8"
英文UTF-8: export LANG="en_US.UTF-8"code

改變單個用戶的語言設置(永久生效)

用戶權限編輯~/.bashrc文件orm

echo 'LANG="en_US.UTF-8"' >> ~/.bashrc
source ~/.bashrc

改變全部用戶的語言設置(永久生效)

Root權限編輯/etc/profile文件ci

echo 'LANG="en_US.UTF-8"' >> /etc/profile
source /etc/profile

CentOS7.x
Root權限編輯/etc/locale.conf文件並保存,而後從新登陸終端。
echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
CentOS5.x
Root權限編輯/etc/sysconfig/i18n文件並保存,而後從新登陸終端。
echo 'LANG="en_US.UTF-8"' > /etc/sysconfig/i18nget

配置生效優先級

~/.bashrc > /etc/profile > /etc/locale.conf,/etc/sysconfig/i18nio

相關文章
相關標籤/搜索