查看中文編碼;bash
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替換;ide
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系統;spa
臨時修改成英文編碼;it
root@localhost:~# exportLANG="en_US.UTF-8" root@localhost:~# exportLANGUAGE="en_US:en"