Manual Pages
The easiest way to get more information about a particular Linux command or program
is to use the man
command followed by the item you want
information on:
This will bring up the manual page ("man page") for the program within the shell,
which have been formatted from the online man pages. These pages can be
referenced from any Linux or Unix shell where man
is installed,
which is most systems. Linux includes a built-in manual for nearly all commands,
so these should be your go-to reference.
The manual is divided into a number of sections by type of topic, for example:
Section | Description |
---|---|
1 | Executable programs and shell commands |
2 | System calls (functions provided by the kernel) |
3 | Library calls (functions within program libraries) |
4 | Special files |
5 | File formats and conventions |
6 | Games |
7 | Miscellaneous (including macro packages and conventions) |
8 | System administration commands (usually only for root) |
If you specify a specific section when you issue the command, only that section
of the manual will be displayed. For example, man 2 mkdir
will
display the Section 2 man page for the mkdir
command. Section 1
for any command is displayed by default.
If your terminal does not support scrolling with the mouse, you can navigate
the man pages by using the up and down arrow keys to scroll up and down or by using the
The man pages follow a common layout. Within a man page, sections may include the following topics:
- NAME
- a one-line description of what it does.
- SYNOPSIS
- basic syntax for the command line.
- DESCRIPTION
- describes the program's functionalities.
- OPTIONS
- lists command line options that are available for this program.
- EXAMPLES
- examples of some of the options available.
- SEE ALSO
- list of related commands.
Example snippets from the man page for the rm
(Remove) command:
Depending on the command, the OPTIONS section can be quite lengthy:
Fun fact: there is even a manual entry for the man
command. Try:
Issuing the man
command with the -k
option will
print the short man page descriptions for any pages that match the command.
For example, if you are wondering if there is a manual entry for the
who
command:
Since there is a man page listed, you can then display the man page for the
who
command with man who
.