Linux man pages cheat sheet
The chapter on one page: what to remember, the commands to have at your fingertips, and flashcards for quick revision.
The chapter in six sentences
man NAMEopens a manual page inless: search with/, move with Space andb, quit withq.- The manual has numbered sections: 1 for user commands, 5 for file formats, 8 for administration commands.
man 5 passwdpicks the section;whatislists which exist. - A SYNOPSIS shows what to type: square brackets are optional,
...may repeat, capitals are placeholders, and{a|b}means choose one. man -k WORDS(apropos) finds pages by keyword in their names and descriptions;man -Ksearches full text;mandbmaintains the index.COMMAND --helpgives a quick option summary;typetells built-ins, aliases and programs apart, andhelpdocuments built-ins.- Packages leave READMEs and examples in
/usr/share/doc, and the full RHEL documentation is online at docs.redhat.com.
Cheat sheet
| Command | Does |
|---|---|
man NAME, man N NAME | Open a manual page; from section N |
whatis NAME (man -f) | One-line descriptions of every page called NAME |
man -k WORDS (apropos) | Search names and descriptions |
man -k -s 8 WORDS | Only section 8 |
man -K WORD | Search the full text of every page (slow) |
man -w NAME | Where the page's file is |
mandb | Rebuild the keyword index (as root) |
COMMAND --help | Quick option summary |
type NAME, type -a NAME | Built-in, alias or program; every match |
help BUILTIN | Help for a shell built-in |
ls /usr/share/doc/PACKAGE | Package documentation |
| In a manual page | Does |
|---|---|
Space / b, d / u | Page down / up, half page down / up |
/text, n, N | Search, next match, previous match |
g / G | Start / end |
q | Quit |
Flashcards
- Which manual sections does an administrator use most, and for what?
- **1** user commands, **5** file formats, **8** administration commands.
- Open the manual page for the /etc/passwd file format?
- `man 5 passwd`
- In a SYNOPSIS, what do [ ], ... and CAPITALS mean?
- Optional, may repeat, and a placeholder to replace with your own value.
- Search manual pages by keyword?
- `man -k WORDS` or `apropos WORDS`
- What builds the index that man -k searches?
- `mandb`, run as root (RHEL runs it when packages install).
- How do you tell whether a command is a built-in?
- `type NAME`. Then `help NAME` documents a built-in.
- Where do packages keep READMEs and examples?
- `/usr/share/doc/PACKAGE`
- Search inside a manual page, and find the next match?
- `/text` then Enter; `n` for the next match, `N` for the previous.