Skip to the workspace
Pebellslearn by building
Shell and Other Basics  ›  Lesson

Command Help — Asking the System Itself

Command Help 10 minUse --help for a quick summary, man for the full manual with numbered sections, man -k to find a command by topic, and help for shell builtins.

linux / Command Help — Asking the System Itself

Explore each scene at your own pace.

01 · The rule

The rule

Command Help — Asking the System Itself

Nobody remembers every option of every command. Experienced Linux users aren't people who know everything. They're people who know how to look things up in seconds, without leaving the terminal. The documentation is already installed, and you just need to know how to reach it.

The rule

Ask the command first: --help for a glance, man for the full story.

--help prints a short summary straight to the terminal. Most GNU commands support it:

$ sort --help
Usage: sort [OPTION]... [FILE]...
  -n, --numeric-sort    compare according to string numerical value
  -r, --reverse         reverse the result of comparisons
...

man opens the full manual page:

$ man sort

The page opens in a pager (usually less), and a few keys are all you need:

Key Does
Space / b page down / back
/word search for "word"; n goes to the next match
q quit

Manual pages are split into numbered sections, and the section number appears in brackets, as in passwd(1):

Section Holds
1 user commands
5 file formats, such as config files
8 administration commands

So man passwd shows the passwd command, and man 5 passwd shows the format of the /etc/passwd file.

Don't know the command's name? Search the short descriptions of every manual page:

$ man -k compress        # same as: apropos compress
gzip (1)   - compress or expand files
...

Shell builtins such as cd and export are part of the shell itself, so they may not have their own man page. In Bash, help cd explains them. type cd tells you whether something is a builtin.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.