"Man" and getting help

command --help and man command are the two most important tools at the command line.

Virtually all commands understand the -h (or --help) option which will produce a short usage description of the command and it's options, then exit back to the command prompt. Type

man -h

or

man --help

to see this in action.

Every command and nearly every application in Linux will have a man (manual) file, so finding them is as simple as typing man command to bring up a longer manual entry for the specified command. For example,

man mv

will bring up the mv (move) manual.

Move up and down the man file with the arrow keys, and quit back to the command prompt with q.

man man

will bring up the manual entry for the man command, which is a good place to start.

man intro

is especially useful - it displays the "Introduction to user commands" which is a well-written, fairly brief introduction to the Linux command line.

There are also info pages, which are generally more in-depth than man pages. Try

info info

for the introduction to info pages.

Searching for man files

If you aren't sure which command or application you need to use, you can try searching the man files.

  • man -k foo, will search the man files for foo. Try

    man -k nautilus

    to see how this works.

    [Note]

    This is the same as the apropos command.

  • man -f foo, searches only the titles of your system's man files. For example, try

    man -f gnome

    [Note]

    This is the same as the whatis command.