Linux man usage and centos installation of Chinese man package

Source: Internet
Author: User
Tags sleep function

In the past two days, I learned about asynchronous notifications in <Linux device driver development details>. One of the fcntl () functions is that I cannot find them. I am very angry and search for them online, there is no good solution,

Finally, a netizen gave me a answer: Because fcntl () is a standard library and cannot be found in the kernel source code, it can only be found in the system, you can use this command to implement: Man fcntl
 
So I just checked man's usage again and found that there are so many uses, cough, and sort it out as follows:
What is man manual?
First, man is the abbreviation of manual. A Chinese statement can be a manual.
 

In the Linux World, when many new users ask for the usage of a command, many impatient veterans usually use a command to answer this helpless newbie, which is usually
Start with man. The helpless newbie knocked on this command to check whether a screen of English was displayed on the terminal,
The veteran means to read the manual by yourself, but reading the manual is also learned and helpless.
I don't know how to exit this command. Next, let's explain the knowledge of man's manual.
 
I. Describes how to use man.
 
1. man pages)
For Linux beginners, the manual page cannot be used as a tutorial, because it is just a concise reference. You can use it when you need to understand the functions of a command and the meanings of relevant parameters.
 
Man in Linux man is the abbreviation of manual. It is used to view various reference manuals in the system, but the manual pages are divided into several parts, as shown below: (Note: The manual page is very important, we generally do not use it, but sometimes you will find that you have used it)
 
1 executable programs or shell commands
 
2 system CILS (functions provided by the kernel)
 
3 Library CILS (functions within program libraries)
 
4 special files (usually found in/Dev)
 
5 file formats and conventions EG/etc/passwd
 
6 Games
 
7 Miscellaneous (including macro packages and conventions), e.g. MAN (7), Groff (7)
 
8 system administration commands (usually only for root)
 
9 kernel routines [non standard]
 
----------------------
 
To explain,

1 is a common command
 
2 is a system call, such as open and write (through this, at least we can easily find the header file to be added to call this function)
 
3 is a library function, such as printf and fread
 
4 is a special file, that is, various device files under/dev.
 
5 indicates the file format. For example, passwd indicates the meaning of each field in the file.
 
6 is reserved for games, defined by each game
 
7. Some variables are attached. For example, global variables such as environ are described here.
 
8 is a command used for system management. These commands can only be used by root, such as ifconfig
 
------------------------------------
 
N new documents may need to be moved to a more appropriate area.
 
O old documents may be retained for a period of time.
 
L local documents related to the specific system.
 
------------------------------------
 
Enter man + number + command/function in shell to find related commands and functions. If no number is added, the Linux man command searches for related commands and functions from the manual with a small number by default.
 
For example, if we enter man ls, "ls (1)" is displayed in the top left corner. Here, "ls" indicates the name of the manual, and "(1) "indicates that the Manual is located in the first chapter. Similarly, we enter" Man ifconfig ", which will display" ifconfig (8) "in the upper left corner )". You can also enter the command "MAN [chapter number] manual name ".
 
Man searches by chapter number. For example, man sleep only displays the manual of the sleep command. To view the sleep function, enter man 3 sleep.
 
------------------------------------
 
Man-F command displays all man program manuals
 
Example: Man-F kill
 
Man n command displays the manual of the specified chapter
 
Man-a command displays the manuals of all chapters
 
Man-W command shows the path of the Manual
 
Man-Aw command combined with-a parameter to display the path of all Chapter manuals
 

The manual page consists of the following parts:
Name command name the syntax format of the synopsis command description of the command function
Opeions describes the options and parameters provided by this command. Examples describes how to use the command. Files the default location on this manual page.
Author the author of the software's reporting bugs tells users to send the found bugs to the developer's copyright information by email
Seealso other programs related to the program
 
For example, if mkdir is used as an example, mkdir (1) In the first line indicates that this command belongs to section 1, which is a USER command, similar to man.
Apt-Get (8) indicates that the apt-GET command is used as the system management tool.
 
Man programs are based on less commands, so the operation commands of less programs can be used in man pages.
 
 
 
You can enter a few commands (these commands are very important. In fact, they are the same as the shortcut keys for editing programs under VI. Haha learns to give a different picture) information Browsing and locating. see the table below:
-------------------------------------------
Button description
-------------------------------------------
J ------ scroll down a row
K ------ scroll up a row

G ------ jump to the first line of the Manual
G ------ jump to the last line of the Manual

/String + enter ------ search for the first sting on the book page
N ------ the next matching in the same direction, which can be used multiple times
N ------ next matching in reverse direction, which can be used multiple times
H ------ get help from the manual page
You can also use Ctrl + F and CTRL + B to flip the whole screen.
 

Q ------ exit the manual page
 
Exercise, use man more and man less to see the difference between them
------------------------------------------
The following describes the differences between the more command and the less function:
More command: Pause the screen when the page is full. Press space to continue displaying the next screen or press the Q key to stop the screen.
Less command: the usage of the less command is similar to that of the more command. It can also be used to browse files on more than one page. The difference is that the less command can not only display the file down by pressing the Space key, but also use the up or down key to scroll the file. To end browsing, press the Q key at the less command prompt.
They have similar functions, but they differ in browsing habits and display methods.
 
 
 
 
 
2. How to install the Chinese man package
 
Chinese man can be helpful for friends who are not good at English. But to learn Linux well, you cannot rely too much on this stuff. After all, learning English well is king.
 
Environment: centos 5.3, kernel: 2.6.18-194. EL5 (Note: This is also true for my computer)
 
Http://cmpp.linuxforum.net
 
This is the source code: http://manpages-zh.googlecode.com/files/manpages-zh-1.5.1.tar.gz
 
Download the installation package now:
 
Wget http://manpages-zh.googlecode.com/files/manpages-zh-1.5.1.tar.gz
 
The procedure is as follows:
 
# Tar zxvf manpages-zh-1.5.1.tar.gz
 
(Note: I added the-C/tmp command to understand the pressure directory)
 
# Cd manpages-zh-1.5.1
 
#./Configure -- prefix =/usr/local/zhman -- disable-zhtw

# Make
 
# Make install
 
The installation is complete. perform the following operations:
 
# Cd ~
 
# Vi. bashrc
 
Add the following in. bashrc:
Alias CMAN = 'man-M/usr/local/zhman/share/man/zh_cn'
 
# Source. bashrc // execute in the command line to make the added alias take effect
 
OK! Now you can use the Chinese version of man. Here it is CMAN. Now you can find that you can use the built-in man and install the Chinese version of CMAN...
 
For example:
 
CMAN CD
 
CMAN ls
 

 

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.