View help for commands in Linux
man command is the help command under Linux. Through the man command, you can view command help, configuration file help, programming help and other information in Linux.
man(option)(parameter)
-a: Search in all man help manuals;
-f: Equivalent to the whatis command, which displays a brief description of the given keyword;
-P: Use paging program when specifying content;
-M: Specifies the path for man manual search.
1: Commands or executable files that users can operate in the shell environment;
2: Functions and tools that can be called by the system kernel, etc.
3: Some commonly used functions and libraries, most of which are C function libraries (libc)
4: Device file description, usually a file under /dev
5: Configuration files or certain file formats
6: games
7: Conventions and protocols, such as Linux file system, network protocol, ASCII code, etc.
8: Management commands available to system administrators
9: Files related to kernel
We enter man ls
, and it will display "LS (1)" in the upper left corner. Here, "LS" represents the manual name, and "(1)" represents that the manual is located in the first chapter. Similarly, we enter man ifconfig
it will say "IFCONFIG(8)" in the uppermost left corner. You can also enter the command like this: "man [chapter number] manual name".
man searches in the order of the manual's chapter numbers, for example:
man sleep
Only the manual for the sleep command will be displayed. If you want to view the library function sleep, you must enter:
man 3 sleep