Display a program’s manual page with man command

Share this post to your friends !

This entry is part 5 of 9 in the series Linux commands: Part 5 - Working with commands

WriteBash - 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
display-a-programs-manual-page-with-man-command Display a program's manual page with man 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.

linuxmint ~ # man 1 passwd
linuxmint ~ # man 2 passwd
No manual entry for passwd in section 2
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # man 3 passwd
No manual entry for passwd in section 3
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # man 4 passwd
No manual entry for passwd in section 4
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # man 5 passwd
linuxmint ~ # man 6 passwd
No manual entry for passwd in section 6
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # man 7 passwd
No manual entry for passwd in section 7
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # man 8 passwd
No manual entry for passwd in section 8
See 'man 7 undocumented' for help when manual pages are not available.
linuxmint ~ # 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.

Continue reading the series«« Previous part: Get help for shell builtins with help commandNext part: Display appropriate commands with “apropos” command »»
If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.


Share this post to your friends !
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

single post bottom banner
«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.