In this article, I will explain the correct way to use man pages since they are the first source to consult when we have a problem with a tool of the operating system. In fact, not having read the corresponding man page and having asked online in forums or mailing lists is considered a lack of respect and interest in many sysadmin circles.
The first thing we need to know is that there are several sections:
1. General user commands
2. System calls and error numbers
3. C programming libraries
4. Devices and device drivers
5. File formats
6. Game instructions
7. Miscellaneous information
8. System maintenance commands
9. Kernel interfaces
We can consult a description of each section as follows:
man SECTION_NUMBER intro
If we want to consult the description of section 8. System maintenance commands, it would be:
As an example, we are going to consult the manual page of the dhclient tool:
In the first line, we see:
DHCLIENT(8) FreeBSD System Manager's Manual DHCLIENT(8)
The number 8 indicates that this manual page corresponds to system administration commands:
8. System maintenance commands
If we are not sure which manual page to search for a specific command, we can execute several commands:
- apropos: It will search for the pattern in the manual pages.
- whatis: It will search for the exact word in the manual pages.
The man pages are divided into several sections:
- NAME: Name of the program or utility. Some programs have multiple names like vi, for example: vi, ex, view.
- SYNOPSIS: Lists possible options and arguments. If we are already familiar with a program but do not remember an option, this header will be useful.
- DESCRIPTION: Contains a brief description of the program, library, or feature. The content of this section will vary depending on the program, file, or library.
- OPTIONS: Shows command-line options and their effects.
- BUGS: Describes known problems with the code. In many cases, we can avoid headaches with buggy programs if we read this section before looking for non-existent solutions.
- EXAMPLES: Are examples of program usage. Some programs are really complicated, and a couple of examples of their use shed more light than a list of options.
- HISTORY: Shows when the command or code was added to the system and if it is not part of FreeBSD, it will indicate its origin.
- SEE ALSO: Commands, files, or libraries related to the currently consulted command.