man
Overview
man displays the system manual. Pages are organized into sections covering user commands, system calls, libraries, file formats, and admin tools. It remains the authoritative offline reference on Linux — faster and more version-accurate than random web snippets for the packages you actually have installed.
Most pages are viewed through a pager (usually less). Press q to quit, / to search.
Syntax
man [section] name
man [options] name
man -k keyword # same as apropos
man -f name # same as whatisSections (common)
| Sec | Content | Example |
|---|---|---|
| 1 | User commands | man 1 printf |
| 2 | System calls | man 2 open |
| 3 | Library functions | man 3 printf |
| 4 | Special files / devices | man 4 null |
| 5 | File formats / configs | man 5 passwd |
| 6 | Games | — |
| 7 | Overviews / conventions | man 7 signal |
| 8 | Admin commands | man 8 mount |
| 9 | Kernel routines (some systems) | — |
When the same name exists in multiple sections (e.g. printf in 1 and 3, passwd in 1 and 5), specify the section number.
Common Options
| Option | Description |
|---|---|
-k / --apropos |
Search short descriptions |
-f / --whatis |
One-line summary for a known name |
-a |
Show all matching sections in turn |
-w / --path |
Print path to the man file, don’t open it |
-W |
List all matching paths |
-K |
Full-text search of page bodies (slow) |
-P pager |
Override pager (less, cat, …) |
-L locale |
Force locale for translated pages |
MANPAGER / PAGER |
Environment override for pager |
MANWIDTH |
Force formatting width (useful in scripts) |
Examples with Explanations
Open a page
man ls
man 5 sshd_config
man 8 systemctl
man mansshd_config lives in section 5 (file formats), not as a user command.
Disambiguate sections
man -a printf # cycle through every section that has printf
man 3 printf # C library specifically
whatis printf # see which sections exist
man -w -a passwd # paths for all passwd pagesSearch when you forget the name
man -k resize
man -k 'disk usage'
apropos network interface
man -K 'AddressFamily' # full-text; can take a whileLocate the source file
man -w ls
# e.g. /usr/share/man/man1/ls.1.gz
zcat "$(man -w ls)" | headUseful when debugging missing or outdated pages after package installs.
Readable width and plain text dump
MANWIDTH=80 man ls
man ls | col -b > /tmp/ls.txt # strip backspaces/overstrike
man -P cat ls | head -40HTML / browser (if supported)
man -H ls # uses browser from $BROWSER or similar
man -Tutf8 ls | less -RScripting existence checks
if man -w journalctl >/dev/null 2>&1; then
echo "journalctl man page present"
fiPager keys (less)
| Key | Action |
|---|---|
q |
Quit |
/pattern |
Search forward |
?pattern |
Search backward |
n / N |
Next / previous match |
g / G |
Top / bottom |
Space / b |
Page down / up |
h |
Help |
Notes / Pitfalls
- Empty or stale results after installing packages: rebuild the index with
sudo mandb(orsudo makewhatison some BSDs / older systems). - Container images often ship without man pages to save space. Install
man-dband the relevant*-doc/ man packages, or read docs on the host. - Section order and default “first match” can surprise you — prefer explicit
man 5 namefor configs. - Locale: if a translated page is incomplete, force English with
LANG=C man …orman -L C …. manis not for shell builtins (cd,[[,declare) — usehelp(bash) instead.
2026-relevant notes
- Systemd, iproute2, and Podman pages are high quality; prefer
man systemctl,man ip-link,man podman-runover outdated blog posts for flag accuracy. - Many modern tools also ship
--helpthat is good enough for flags; usemanwhen you need semantics, exit codes, and file formats. - Container and snap sandboxes may not see host man pages; read docs in the environment where the tool is installed.
Additional Resources
man man,man man-pages,man 7 man-pages- Linux man-pages project