Chapter 4: Getting help

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

Cheat sheet

CommandDoes
man NAME, man N NAMEOpen 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 WORDSOnly section 8
man -K WORDSearch the full text of every page (slow)
man -w NAMEWhere the page's file is
mandbRebuild the keyword index (as root)
COMMAND --helpQuick option summary
type NAME, type -a NAMEBuilt-in, alias or program; every match
help BUILTINHelp for a shell built-in
ls /usr/share/doc/PACKAGEPackage documentation
In a manual pageDoes
Space / b, d / uPage down / up, half page down / up
/text, n, NSearch, next match, previous match
g / GStart / end
qQuit

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.