查看中文编码;
root@localhost:~# cat /etc/default/locale LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh" LC_NUMERIC="zh_CN" LC_TIME="zh_CN" LC_MONETARY="zh_CN" LC_PAPER="zh_CN" LC_NAME="zh_CN" LC_ADDRESS="zh_CN" LC_TELEPHONE="zh_CN" LC_MEASUREMENT="zh_CN" LC_IDENTIFICATION="zh_CN"
用sed替换;
root@localhost:~# sed -i's/LANG="zh_CN.UTF-8"/LANG="en_US.UTF-8"/g'/etc/default/locale root@localhost:~# sed -i's/LANGUAGE="zh_CN:zh"/LANGUAGE="en_US:en"/g' /etc/default/locale
检查结果;
root@localhost:~# cat /etc/default/locale LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_NUMERIC="zh_CN" LC_TIME="zh_CN" LC_MONETARY="zh_CN" LC_PAPER="zh_CN" LC_NAME="zh_CN" LC_ADDRESS="zh_CN" LC_TELEPHONE="zh_CN" LC_MEASUREMENT="zh_CN" LC_IDENTIFICATION="zh_CN"
*修改完成后注销或reboot系统;
临时修改为英文编码;
root@localhost:~# exportLANG="en_US.UTF-8" root@localhost:~# exportLANGUAGE="en_US:en"