Linux Build man Chinese manual illustration (Man-pages-zh help page)

Source: Internet
Author: User
Tags character set manual locale mkdir pack

It's a good thing to have a Chinese help manual just to learn Linux. Linux has its own help in many languages, the current version of Linux in a variety of distributions has no Chinese help manuals. It makes sense to create a suitable Chinese handbook. The configuration process is actually relatively simple, only need to know the Chinese package, and then put the man can search the directory, the basic can be.
Here are a few steps:
Download the Open source man-pages Chinese manual Package
Configure the Extract manual pack
Test Installation Chinese Pack
First, install the Chinese Help Manual in the personal working directory
The advantage is that each user, log in can have their own language version of the Help manual. The direct manual will not be called on each other, independent and flexible.
1. Download Open source Man Chinese manual package (man-pages man page)


Download development packages via Linux wget
[Chengmo@centos5 ~]$ wget http://manpages-zh.googlecode.com/files/manpages-zh-1.5.tar.gz
Input can

2, Decompression man Chinese manual package
Just set up the MAN/ZH_CN directory under your working directory, unzip the compressed package and follow the specification directory. The man command can be searched.
Under special instructions, the following installation ensures that your locale is set to Chinese:
[Chengmo@centos5 ~]$ Echo $LANG zh_cn. GB2312
If not: through export LANG=ZH_CN. GB2312
If you find that the above execution does not pass, you can run: locale-a Check the character set that your system supports

The code is as follows:
[Chengmo@centos5 ~]$ CD ~
#进入当前目录
[Chengmo@centos5 ~]$ mkdir-p MAN/ZH_CN
#建立目录man and subdirectories ZH_CN
[Chengmo@centos5 ~]$ Tree Mans
Mans
'--ZH_CN
#目录以及子目录已经可以了, now only need to extract the compressed package to the ZH_CN Chinese directory
[Chengmo@centos5 ~]$ TAR-XZVF manpages-zh-1.5.tar.gz
Manpages-zh-1.5/src/mann/expr.n
Manpages-zh-1.5/src/mann/fblocked.n
Manpages-zh-1.5/src/mann/fconfigure.n
Manpages-zh-1.5/src/mann/fcopy.n
Manpages-zh-1.5/src/mann/file.n
Manpages-zh-1.5/src/mann/fileevent.n
Manpages-zh-1.5/src/mann/filename.n
Manpages-zh-1.5/src/mann/flush.n
Manpages-zh-1.5/src/mann/focusnext.n
Manpages-zh-1.5/src/mann/for.n
Manpages-zh-1.5/src/mann/foreach.n
#...... Unpack data Packets
[Chengmo@centos5 ~]$ CD manpages-zh-1.5
[Chengmo@centos5 manpages-zh-1.5]$ ls
Copying Debian DOCS Makefile Man-pages-zh_cn.spec Raw Readme README. GB src utils
#该目录结构 support make installation, you can generate compilation files by making command, or you can copy the inside SRC directory installation directly
[Chengmo@centos5 manpages-zh-1.5]$ make
mkdir UTF-8
Cp-r src/man* utf-8/
#已经生成了: UTF-8 The file below the directory, just copy the directory to ~/MAN/ZH_CN below
[Chengmo@centos5 manpages-zh-1.5]$ cp-r utf-8/* ~/man/zh_cn/
A few steps have been taken to install the Help manual below the MAN/ZH_CN under your working directory.
3, the Test man Chinese help Manual is installed successfully
Check below to see if the man's Chinese manual is added to the man path.

The code is as follows:
[Chengmo@centos5 manpages-zh-1.5]$ Man-w
/usr/kerberos/man:/usr/local/share/man:/usr/share/man/zh_cn:/usr/share/man:/home/chengmo/man/zh_cn:/home/ Chengmo/man:/usr/local/man
#发现已经在MANPATH路径加入了:/home/chengmo/man and:/HOME/CHENGMO/MAN/ZH_CN
[Chengmo@centos5 ~]$ Man-aw passwd
/usr/share/man/man1/passwd.1.gz
/usr/share/man/man5/passwd.5.gz
/home/chengmo/man/zh_cn/man5/passwd.5
#发现已经找到中文手册了
[Chengmo@centos5 ~]$ man 5-aw passwd
/usr/share/man/man5/passwd.5.gz
/home/chengmo/man/zh_cn/man5/passwd.5
#读取领域5限定类型, so that the original system of English also retained, the Chinese language is also very convenient
[Chengmo@centos5 ~]$ man 5-a passwd
#显示英文的, press Q will come out of the Chinese document

Second, all users common Chinese help manual
This principle is basically the same as the individual user, but the manual is placed in the public directory, not the personal directory.

The code is as follows:
[Chengmo@centos5 ~]$ TREE/USR/SHARE/MAN/ZH_CN
/usr/share/man/zh_cn
|--Man1
| '--newgrp.1.gz
'--MAN8
|--adduser.8.gz
|--chpasswd.8.gz
|--groupadd.8.gz
|--groupdel.8.gz
|--groupmod.8.gz
|--useradd.8.gz
|--userdel.8.gz
'--usermod.8.gz
The System default public manual page address is generally under:/usr/share/man below, put the following ZH_CN directory.

The code is as follows:
[Chengmo@centos5 manpages-zh-1.5]$ make
mkdir UTF-8
Cp-r src/man* utf-8/
#已经生成了: UTF-8 The file below the directory, just copy the directory to ~/MAN/ZH_CN below
[Chengmo@centos5 manpages-zh-1.5]$ cp-r utf-8/*/usr/share/man/zh_cn/
Other man.config configurations do not need to be modified.

The code is as follows:
Check:
[Chengmo@centos5 ~]$ man 5-aw passwd
/usr/share/man/man5/passwd.5.gz
/user/share/man/zh_cn/man5/passwd.5

The instruction manual has been installed.
Here are 2 ways to install the introduction, feel the Chinese handbook is very good, you can try, I personally prefer or installed to the working directory is better, because there are a lot of Linux version, and commands have a lot of seemingly the same, but actually some differences, this Chinese manual update does not have the corresponding software update fast.  When used to find the command inconsistent time, still have to exquisite elegant original English. It's a good idea to keep both English and Chinese manuals.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.