Advanced usage of the Man handbook in Linux

Source: Internet
Author: User

Linux provides a rich help manual that you do not have to look for when you need to see the parameters of a command, as long as you have a man.
The Linux Man Handbook has several chapters:

1, standard commands (command)
2. System calls (Systems call)
3. Library functions (Libraries function)
4, special devices (equipment description)
5. File formats (document format)
6. Games and toys (game and entertainment)
7. Miscellaneous (Miscellaneous)
8, Administrative Commands (Administrator command)


For example: We enter the man LS, it will show "LS (1)" in the upper left corner, where "ls" denotes the manual name, and "(1)" means that the manual is in the first section, similarly, we enter "man ifconfig" it will show "ifconfig (8)" in the upper left corner. You can also enter the command: "Man [chapter number] Manual name".

The man is searched in the order of the chapter number of the manual, for example:

Mans sleep

Only the Manual of the Sleep command is displayed, and if you want to see the library function sleep, enter:

Mans 3 Sleep

Ubuntu default is not installed in the C language library function man manual

1. Add Library function Manual
Ubuntu By default is not installed in the C language library function man manual, so you in the man perror and SendTo and other functions will show no related documents problems, this problem let me depressed for a long time. Workaround:
sudo apt-get install Manpages-dev
2. Let man display Chinese
Ubuntu source contains the Chinese man pack, so do not go down from other places, directly
sudo apt-get install Manpages-zh
But this is not the default display of the Chinese, modify the man's default language

sudo gedit/etc/manpath.config to change all the/usr/share/man inside into/USR/SHARE/MAN/ZH_CN.

Quit after saving, and then you try man ls

to show English without Chinese help
It's not enough to finish the second part. Some C-language functions (do not use the more famous functions such as Printf,socket, these have been Chinese help man 3 sleep) when they will find that there is no help, and just now clearly in the first step has been installed AH. This is because you change the/usr/share/man to/USR/SHARE/MAN/ZH_CN of the operation so that man only in Chinese help search, if not directly give up, so also need the following actions, in order to let man without Chinese help automatically display English help, If there is no English, there is no real.
sudo gedit/etc/manpath.config
then search for the place you just changed, and then add the same line behind it, just the back of the directory with the original/usr/share/ Man, such as the modified
manpath_map/bin          /usr/share/man/zh_cn
add another line
manpath_map/bin          /usr/share/man


Advanced usage of the Man handbook in Linux

Related Article

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.