Display a program’s manual page with man command

by Daniel Pham
Published: Updated:
This entry is part 5 of 9 in the series Linux commands: Part 5 - Working with commands

This article will guide you to use the man command to display a program’s manual page.

Most programs executed in Linux include a section called manual or man page.

What is a man page?

Man page is understood as a document describing program execution information, executable programs herein can be understood as Linux commands.

The man page displays information in the terminal window and follows the format of the less command.

That is, you view the man page content in a separate window and use the arrow keys to turn the page.

Or if you use a terminal on a Linux desktop, you can scroll the mouse pointer to forward the information page in the man page.

The page usually includes title information, syntax structure, purpose of the command, options of the command and description of options.

Note: man page only includes descriptive information about the program, not including tutorials or examples.

Use the man command to display the man page

The syntax of man command is quite simple:

$ man program

With the program is the name of the command you want to see.

For example, I will display the man page of the mkdir command, type:

$ man mkdir
use man command to display man page of mkdir command
Use man command to display man page of mkdir command.

Note: to quit the man page, press the q key on your keyboard.

Man page organiztion

The man page is divided into different sections and numbered. This is also useful in case you want to see a section in the program documentation.

The following table will list all the sections of the man page.

SectionContents
1Executable programs or shell commands
2System calls (functions provided by the kernel)
3Library calls (functions within program libraries)
4Special files (usually found in /dev)
5File formats and conventions eg /etc/passwd
6Games
7Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8System administration commands (usually only for root)
9Kernel routines [Non standard]

To see more information about the man page sections, you can read this link or type the command below.

$ man man

Notice that DESCRIPTION will have the content like this.

DESCRIPTION
       man  is  the system's manual pager.  Each page argument given to man is normally the name of a
       program, utility or function.  The manual page associated with each of these arguments is then
       found  and displayed.  A section, if provided, will direct man to look only in that section of
       the manual.  The default action is to search in all of the available sections following a pre-
       defined  order  ("1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7" by default, unless overridden by the
       SECTION directive in /etc/manpath.config), and to show only the first page found, even if page
       exists in several sections.

       The  table  below  shows the section numbers of the manual followed by the types of pages they
       contain.

       1   Executable programs or shell commands
       2   System calls (functions provided by the kernel)
       3   Library calls (functions within program libraries)
       4   Special files (usually found in /dev)
       5   File formats and conventions eg /etc/passwd
       6   Games
       7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
       8   System administration commands (usually only for root)
       9   Kernel routines [Non standard]

       A manual page consists of several sections

Now try some examples with the section in the man page. I will see the documentation for the passwd command.

$ man 1 passwd
$ man 2 passwd
No manual entry for passwd in section 2
See 'man 7 undocumented' for help when manual pages are not available.
$ man 3 passwd
No manual entry for passwd in section 3
See 'man 7 undocumented' for help when manual pages are not available.
$ man 4 passwd
No manual entry for passwd in section 4
See 'man 7 undocumented' for help when manual pages are not available.
$ man 5 passwd
$ man 6 passwd
No manual entry for passwd in section 6
See 'man 7 undocumented' for help when manual pages are not available.
$ man 7 passwd
No manual entry for passwd in section 7
See 'man 7 undocumented' for help when manual pages are not available.
$ man 8 passwd
No manual entry for passwd in section 8
See 'man 7 undocumented' for help when manual pages are not available.
$ man 9 passwd
No manual entry for passwd in section 9
See 'man 7 undocumented' for help when manual pages are not available.

As you can see from the above results, the passwd command only has 3 sections of 1, 2 and 5. Therefore, not all man pages of the programs have all 9 sections.

Conclusion

By using the man command, you can display the content of the man page. It will give you a lot of information about the command or program you are trying to know.

From definitions, goals, abbreviations of commands, options, and so on.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series Navigation«« Previous part: Get help for shell builtins with help commandNext part: Display appropriate commands with “apropos” command »»

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.