解決CentOS7控制檯中文顯示亂碼

## 查看locale.conf文件內容
cat /etc/locale.conf

文件內容爲,LANG="en_US.UTF-8"。bash

## 備份該文件,以防萬一
cp /etc/locale.conf /etc/locale.conf_bak

從新編輯該文件:測試

## 使用vi編輯這個文件
vi /etc/locale.conf

內容以下:code

LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"

從新或者使用exit命令,再次進入系統後輸入:it

## 輸入ll測試是否修改爲中文
[root@localhost ~]# ll
總用量 8
-rw-------. 1 root root 1267 12月 28 05:47 anaconda-ks.cfg
drwxr-xr-x. 3 root root 4096 1月   9 10:22 setup
[root@localhost ~]#

total已經替換成中文"總用量"了,修改爲功。class

相關文章
相關標籤/搜索