前言
當我們執行某個命令的 --h 或者 --help 時,默認輸出的都是英文,接下來我們來說下如何將所有幫助文件顯示成中文哦!
設置系統默認語言為中文
對應每個shell而言,重啟后會變成英文,所以每次都需要執行
echo $LANG
輸出:en_US.UTF-8 (此時為英文)
LANG=zh_CN.UTF-8 echo $LANG
輸出:zh_CN.UTF-8 (此時為中文)
安裝中文支持
yum groupinstall "Chinese Support"
增加epel的repo
備份epel源
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
安裝epel配置文件(具體根據系統版本和實際源修改)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
清除本地依賴關系
因為每個網站的依賴關系不同所以在使用前需要清除本地依賴文件。
yum clean all yum makecache
安裝man-pages
yum search man-pages yum install man man-pages man-pages-zh-CN
驗證
ls --help man bash