The Unix or Linux command tool man is a short term for the manual page. The man command tool is used to get manuals for any commands in the Linux system. The tool shows a short summary and detailed options description for each command. And it has multiple sections, to quickly navigate to.
A Linux user always can request to display a manual page or man page by simply typing man followed by a space and then the command as argument.
If you provide a section number in the command, then
man will be redirected to look into that section number and that section page will be displayed. And if not, then by default it will display the first page and you have to go through the entire sections in a pre-defined manner.
Syntax of man:
$ man [option(s)] [keyword(s)]
Options are optional here, we can get to the manual quickly by giving the command name only.
For example, the following command shows the manual of ls command.
$ man ls
How Output is display in the Command Shell?
man displays its output through a pager. It appears at once and there is no option to scroll bars to scroll the page.
A colon at the bottom displays end of the on-screen page. In Linux, the space bar or ‘f’ is use to go forward and to go the backward page you can use ‘b’.
To exit from the on-screen page use ‘q’ and you will be redirect to the shell program. And, for help press ‘h’.
Sections in the man Page:
man page is divide into different sections. Each section is divide based upon a particular topic.
The man pages have a number written in the parentheses after the command. These numbers represent the section number. See the terminal for
man ls, you can see
ls(1) is at the top, which shows that it is from section 1.
If you mention a particular section number then your man page will be redirect to that section.
The common sections in manuals are:
Executable programs and shell commands
File formats and conventions
System administration commands