man command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS AND SEE ALSO.
- Every manual is divided into the following sections:
- Executable programs or shell commands
- System calls (functions provided by the kernel)
- Library calls (functions within program libraries
- Special files (usually found in /dev)
- File formats and conventions eg /etc/passwd
- Miscellaneous (including macro packages and conventions), e.g. groff(7)
- System administration commands (usually only for root)
- Kernel routines [Non-standard]
1. No Option: It displays the whole manual of the command.
2. Section-num: Since a manual is divided into multiple sections so this option is used to display only a specific manual.
In this example, the manual pages of command %u2018intro%u2018 are returned which lies in section 2.
3. -f option: One may not be able to remember the sections in which a command is present. So this option gives the section in which the given command is present.
4. -a option: This option helps us to display all the available intro manual pages in succession.
In this example you can move through the manual pages(sections) i.e either reading(by pressing Enter) or skipping(by pressing ctrl+D) or exiting(by pressing ctrl+C).
5. -w option: This option returns the location in which the manual page of a given command is present.