設置 ~/.bash_profile 或 ~/.bashrc 添加下面兩句:
export LC_CTYPE=zh_CN.GB2312
export LANG=en_US.UTF-8
其余均保持原有 en_US.UTF-8 不變即可。前提是你裝了中文語言包。
注: .bash_profile 為用戶登陸時加載的profile, 只在用戶登陸時執行
.bashrc 為shell profile,每執行一個 shell, 就會被執行一次
可用 locale 命令查看這些設置值
原文轉自:http://www.kjueaiud.com