Linux / UNIX: Getting help with man page

Posted on in Categories , , , , , , , , , , , last updated August 10, 2007

Q. I’ve CentOS 5 server located in a remote data center. How do I get more help about command and its syntax?

A. Linux and UNIX comes with man (manual) pages. man command displays pages from reference manual. You can learn about command and it syntax. Each man page has following information:
=> Command name along with a short description

=> A SYNOPSIS of command usages

=> A Description

=> A listing of all its options (switches)

=>A list of config files or associated files

man Page sections

Each man page comes in sections. The table below shows the section numbers of the manual followed by the types of pages they contain:

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

So you see commands or files are referred by a name followed by manual section number in parentheses. For example, useradd(8) refers to the user add command from sys admin section # 8.

man command examples

Just use man command as follows:
man {command-name}
man {section} {command-name}

For example, display clear command man page, enter:
$ man clear
Display passwd file format man page (from section # 5):
$ man 5 passwd
Display more information about passwd command itself (from section # 1):
$ man 1 passwd

Search man page referenced by printf

Lookup the manual pages referenced by smail and print out the short descriptions of any found. For example:
$ man -f printf

printf (1)           - format and print data
printf (3)           - formatted output conversion

This command is equivalent to whatis printf:
$ whatis -r printf

Search man page by keywords

Search the short descriptions and manual page names for the keyword printf as regular expression. Print out any matches.
$ man -k passwd
$ man -k printf

This command is equivalent to apropos printf:
$ apropos printf
$ apropos passwd

Display all matching man pages

You can display, in succession, all of the available passwd manual pages contained within the manual. It is possible to quit between successive displays or skip any of them.
$ man -a passwd
To view next man page just hit [Enter] key, to skip press [CTRL+D] and to quit type [Ctrl+C].

info documentation

You can read documentation in Info format. This is another system that organizes its information into sections. info, a command used to view such documentation produced by Texinfo, a computer program documentation system developed for and by the GNU Project.

info syntax

info {command-name}

For example display ls command info page:
$ info ls
In some cases, info command can offer more detailed help as compare to man page. For example try following two commands:
$ man date
$ info date

Info page navigation commands

  • q – Quit info page
  • n – Goto next section
  • p – Goto previous section
  • u – Goto one level up

You can start at buffers node within emacs manual
$ info emacs buffers


You may also find /usr/share/doc a good place for more documentation. Both Gnome and KDE provides graphical help system under help menu. You can get help by pressing F1 key.