教你配置 CentOS 7 man 命令帮助显示简体中文
如果英文不好,看 manual 手册会很吃力,本文档将详细介绍如何配置 CentOS 7 man 命令帮助显示简体中文。文内含长段代码可复制可往左滑,希望对大家有帮助!
将 manpages-zh-1.5.1.tar.gz 源码包下载到本地
安装 lrzsz 工具
[root@centos7 ~]# cd /usr/local/src
[root@centos7 src]# yum install -y lrzsz
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 lrzsz.x86_64.0.0.12.20-36.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
========================================================================
Package 架构 版本 源 大小
========================================================================
正在安装:
lrzsz x86_64 0.12.20-36.el7 base 78 k
事务概要
========================================================================
安装 1 软件包
总下载量:78 k
安装大小:181 k
Downloading packages:
lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : lrzsz-0.12.20-36.el7.x86_64 1/1
验证中 : lrzsz-0.12.20-36.el7.x86_64 1/1
已安装:
lrzsz.x86_64 0:0.12.20-36.el7
完毕!
[root@centos7 src]# ls
manpages-zh-1.5.1.tar.gz
[root@centos7 src]# sz manpages-zh-1.5.1.tar.gz
rz
zmodem trl+C ȡ
100% 1 KB 1 KB/s 00:00:01 0 Errorsgz...
<以上代码可复制粘贴,可往左滑>
上传源码包
[root@centos7 src]# rm -rf *
[root@centos7 src]# ls
[root@centos7 src]# rz
rz waiting to receive.
zmodem trl+C ȡ
100% 1919 KB 1919 KB/s 00:00:01 0 Errorsgz...
[root@centos7 src]# ls
manpages-zh-1.5.1.tar.gz
[root@centos7 src]# file manpages-zh-1.5.1.tar.gz
manpages-zh-1.5.1.tar.gz: gzip compressed data, from Unix, last modified: Thu Apr 3 23:29:16 2008, max compression
[root@centos7 src]# tar xf manpages-zh-1.5.1.tar.gz
[root@centos7 src]# ls
manpages-zh-1.5.1 manpages-zh-1.5.1.tar.gz
[root@centos7 src]# cd manpages-zh-1.5.1
[root@centos7 manpages-zh-1.5.1]# ls
aclocal.m4 configure DOCS Makefile.am NEWS utils
AUTHORS configure.in INSTALL Makefile.in README
ChangeLog COPYING install-sh missing src
<以上代码可复制粘贴,可往左滑>
关闭 zhtw
[root@centos7 manpages-zh-1.5.1]# ./configure --disable-zhtw
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating DOCS/Makefile
config.status: creating src/Makefile
config.status: creating src/man1/Makefile
config.status: creating src/man1/zh_CN/Makefile
config.status: creating src/man1/zh_TW/Makefile
config.status: creating src/man2/Makefile
config.status: creating src/man2/zh_CN/Makefile
config.status: creating src/man2/zh_TW/Makefile
config.status: creating src/man3/Makefile
config.status: creating src/man3/zh_CN/Makefile
config.status: creating src/man3/zh_TW/Makefile
config.status: creating src/man4/Makefile
config.status: creating src/man4/zh_CN/Makefile
config.status: creating src/man4/zh_TW/Makefile
config.status: creating src/man5/Makefile
config.status: creating src/man5/zh_CN/Makefile
config.status: creating src/man5/zh_TW/Makefile
config.status: creating src/man6/Makefile
config.status: creating src/man6/zh_CN/Makefile
config.status: creating src/man6/zh_TW/Makefile
config.status: creating src/man7/Makefile
config.status: creating src/man7/zh_CN/Makefile
config.status: creating src/man7/zh_TW/Makefile
config.status: creating src/man8/Makefile
config.status: creating src/man8/zh_CN/Makefile
config.status: creating src/man8/zh_TW/Makefile
config.status: creating src/mann/Makefile
config.status: creating src/mann/zh_CN/Makefile
config.status: creating src/mann/zh_TW/Makefile
config.status: creating utils/Makefile
manpages-zh configure summary
=============================
UTF-8 : true
zh_CN : true
zh_TW : false
<以上代码可复制粘贴,可往左滑>
编译安装
[root@centos7 manpages-zh-1.5.1]# make && make install
<以上代码可复制粘贴,可往左滑>
设置环境变量
[root@centos7 manpages-zh-1.5.1]# vim /etc/profile.d/cman.sh #新文件
#输入以下内容
alias cman='man -M /usr/local/share/man/zh_CN'
<以上代码可复制粘贴,可往左滑>
执行别名文件让该文件生效
[root@centos7 manpages-zh-1.5.1]# source /etc/profile.d/cman.sh
<以上代码可复制粘贴,可往左滑>
执行 man ls 或者 cman ls 查看配置结果是否成功
[root@centos7 manpages-zh-1.5.1]# cman ls
LS(1) General Commands Manual LS(1)
NAME
ls, dir, vdir - 列目录内容
提要
ls [选项] [文件名...]
POSIX 标准选项: [-CFRacdilqrtu1]
GNU 选项 (短格式):
[-1abcdfgiklmnopqrstuxABCDFGLNQRSUX] [-w cols] [-T cols] [-I
pattern] [--full-time]
[--format={long,verbose,commas,across,vertical,single-column}]
[--sort={none,time,size,extension}]
[--time={atime,access,use,ctime,status}]
[--color[={none,auto,always}]] [--help] [--version] [--]
描述( DESCRIPTION )
<以上代码可复制粘贴,可往左滑>
总 结
END
官方站点:www.linuxprobe.com
Linux命令大全:www.linuxcool.com
Linux系统下载站:www.linuxdown.com
刘遄老师QQ:5604922
Linux技术交流群:193666693
(新群,火热加群中……)
书籍在线学习(电脑阅读效果佳):
http://www.linuxprobe.com/chapter-00.html
想要学习Linux系统的读者可以点击"阅读原文"按钮来了解书籍《Linux就该这么学》,同时也非常适合专业的运维人员阅读,成为辅助您工作的高价值工具书!