1.查看
cat /etc/locale.conf
LANG=en_US.UTF-8
2.备份
cp /etc/locale.conf /etc/locale.conf_bak
3.编辑变量
cat > /etc/locale.conf <<EOF
LANG="zh_CN.UTF-8"
EOF
cat > /etc/sysconfig/i18n <<EOF
LANG="zh_CN.UTF-8"
EOF
vi /etc/profile
#尾部添加
export LANG="zh_CN.UTF-8"source /etc/sysconfig/i18n
source /etc/locale.conf
source /etc/profile
4.退出服务器,然后再次登入
标签:LANG,中文,UTF,CentOS,locale,乱码,etc,conf,zh From: https://blog.51cto.com/dxbp/7638058exit