1、安裝中文語言包
命令如下:
# yum -y groupinstall chinese-support
2、編輯配置文件,設置相應的字符集
臨時生效:
# export LANG="zh_CN.UTF-8" # 設置為中文 # export LANG="en_US.UTF-8" # 設置為英文,我比較喜歡這樣 export
(免費在線視頻教程分享:linux視頻教程)
永久生效:
## 永久生效, 編輯/etc/sysconfig/i18n(最好reboot一下) LANG="zh_CN.UTF-8"
或者,編輯 /etc/profile配置文件,添加如下代碼:
export LANG="zh_CN.UTF-8"
3、重新載入
# . /etc/profile
4、查看當前的字符集
# echo $LANG
相關文章教程推薦:linux教程