Guide to Unix/Commands/Getting Help

manEdit

man displays the manual page for the specified command

A useful option is:

$ man -k TEXT  

This searches manual page titles and synopsis lines for TEXT

Examples:

To display the manual page for the chown command:

$ man chown

man has different sections.

  • section 1 is user commands
  • section 2 is system calls (used by programs to communicate with the kernel)
  • section 3 is library reference (for programming in C)
  • section 4 is device drivers
  • section 5 is configuration files and other file formats
  • section 6 is games
  • section 7 is miscellaneous (for example, "ascii" map and C "operator" precedence)
  • section 8 is system commands (like user commands, but mostly for root)

A section number can be specified before the page name. For example, man chmod normally shows the user command "chmod". To see the system call "chmod":

$ man 2 chmod

To search the man pages for "newsgroups",

$ man -k newsgroups
actsync              (8)  - synchronize newsgroupsoups
newsgroups           (1)  - a program to list unsubscribed newsgroups
  • If this does not work you may have to run the makewhatis command.

infoEdit

info is an advanced man command that is sometimes available. It displays the improved manual pages in Info format for specified command.

Examples:

To display the manual page for the grep command:

$ info grep

To find occurrence of 'grep' in all info manual pages:

$ info --apropos grep
"(autoconf-2.13)Examining Declarations" -- EGREP_CPP
"(autoconf-2.13)Examining Declarations" -- EGREP_HEADER
"(autoconf-2.13)Old Macro Names" -- HEADER_EGREP
...

To see the physical location of 'grep' info manual page:

$ info -w grep
/usr/share/info/grep.info.gz

To view a file a info page:

$ info -f ./some_cmd.info.gz

aproposEdit

apropos searches the manual page short descriptions for a specified keyword

On many systems this is exactly the same as the -k option of the man command.

Examples:

$ apropos newsgroups
active               (5)  - list of active Usenet newsgroups
newsgroups           (1)  - a program to list unsubscribed newsgroups

whatisEdit

whatis displays short man page descriptions. Unlike

Examples:

$ whatis info
info (1)             - read Info documents
info (5)             - readable online documentation
$ whatis chmod
chmod (1) - change file modes
chmod, fchmod (2) - change mode of file

makewhatisEdit

makewhatis creates the database for the whatis, appropos, and man -k commands. This is commonly run automatically by your system however sometimes you need to run this manually.

Examples:

# makewhatis
$ sudo makewhatis
Last modified on 31 August 2009, at 20:22