C.W.K.
Stream
Lesson 07 of 10 · published

Man Pages

~15 min · man, documentation, less, info

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The original built-in docs

Every Unix command since 1971 has shipped with a manual page. man ls, man bash, man printf — they all open in less, the same pager you use for log files. Once you trust man pages, you stop tab-out-to-Google for syntax.

Man page sections

Man pages are organized into 9 numbered sections:

  • 1 — User commands (man 1 ls)
  • 2 — System calls (man 2 open)
  • 3 — Library functions (man 3 printf — C, different from man 1 printf the shell built-in)
  • 5 — File formats (man 5 crontab)
  • 7 — Miscellaneous concepts (man 7 signal)
  • 8 — System administration (man 8 launchd)

If two pages share a name, man -a walks all of them.

Searching inside a man page

Once a man page is open, you are in less. Press / and type a pattern to search. n = next match, N = previous, q = quit. g = top, G = bottom. Type h in less to see the full keymap.

Searching across all man pages

apropos (alias man -k) searches the one-line description of every man page. apropos socket turns up every command and library function related to sockets. man -f socket shows the title line for one specific name.

When man is not enough

Man pages are exhaustive but terse. For a friendlier experience try tldr (community examples) or cheat (cheat sheets). We cover both in the next lesson — they complement man, they don't replace it.

Code

Navigate man pages like a pro·bash
man bash                  # opens in less
# Inside: /pattern then n/N to jump matches
# G goes to bottom, g to top, q to quit
man -k git                # apropos — all related man pages
man -a printf             # walk both shell and C printf
man 5 crontab             # file format, not the command
Pipe a man page elsewhere·bash
# Plain text dump (no formatting escapes)
man ls | col -b > ls-manual.txt
# Search inside without opening
man bash | grep -n 'PROMPT_COMMAND'

External links

Exercise

Run man ls and use / to search for -h. Note what it does. Quit with q. Then apropos network and pick three you have never seen — open each with man <name> and read the SYNOPSIS line. That's a 5-minute fluency boost.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.