Skip to content
Beginner LinuxLesson 20 of 27 3 min read

Getting Help: man, help, and Reading Docs

man pages, --help, apropos, and the habit of looking things up instead of memorizing them.

On this page6 sections

No one memorizes every flag of every command - not even people who have used Linux for twenty years. The actual skill is knowing where to look, fast, without leaving the terminal. This lesson is short on purpose: it's a habit, not a topic.

man: the manual, built in

Nearly every command on a real Linux system ships a manual page installed right alongside it:

bash
man ls
man grep
man 5 passwd

That 5 in the last example is a section number - man pages are organized into numbered sections so the same word can mean different things:

SectionContents
1User commands (ls, grep, ...)
5File formats (/etc/passwd's layout, crontab's syntax)
8System administration commands (useradd, mount)

man passwd alone opens section 1 (the command that changes a password); man 5 passwd opens section 5 (the file format of /etc/passwd itself) - same word, different manual.

On a real terminal, man opens in a pager: space or f for the next page, b for the previous page, /word to search, n for the next match, and q to quit.

--help: the quick version

Most commands also understand a --help flag that prints a short usage summary straight to the terminal, without opening a pager - useful when you just need a flag's name, not the full manual:

bash
grep --help
tar --help

Finding the right command

  • apropos <word> searches every man page's short description for a keyword - use it when you know what you want to do but not the command's name.
  • whatis <command> prints just a command's one-line summary.
  • which <command> prints the full path of the program that would actually run.
  • type <command> reports whether a name is a shell builtin, an alias, or a program on disk - useful when a command doesn't behave the way its man page says it should.
bash
apropos copy
whatis cp
which python3

info: the deeper alternative

A handful of GNU tools (notably bash itself, and coreutils) ship even more detailed info pages, browsable as a hyperlinked document with info <command>. You'll meet it far less often than man, but it's worth knowing it exists when a man page feels incomplete.

Try it

Run these in the practice terminal (opens in a new tab). It opens in a new tab, so you keep your place here.
bash
man grep
man nosuchcommand
which python3
which totallymadeupcmd
apropos copy

Notice man nosuchcommand fails cleanly with "No manual entry" - that's the correct, expected response for a command that was never installed, exactly like a real system.

Further reading

  • "The Linux Command Line" by William Shotts (No Starch Press) - opens with a chapter on exactly this: how to explore and learn commands you don't already know, using the system's own documentation.
  • "How Linux Works" by Brian Ward (No Starch Press) - explains how man pages are packaged and installed, which demystifies why some minimal systems are missing them entirely.

Challenge

Look up the manual entry for ls, then confirm where grep would run from - both in one line joined with &&.

Want to experiment first? Try things in the practice terminal (opens in a new tab), then enter the command that solves the task here.

Quiz

Lock in the concepts. Score at least 80% to mark the lesson complete.

0 of 3 answered

Done with this one?

Skipped the challenge? You can mark the lesson complete by hand.

Your notes

Kept on this browser only.