Manual Pages
Challenge Gallery
Quick Reference
| Command | What It Does |
|---|---|
man ls |
Open the manual page for ls |
man -k keyword |
Search man page descriptions (same as apropos) |
man 3 printf |
Open section 3 (C library) page for printf |
man man |
The manual for the manual |
whatis ls |
One-line description of ls |
ls --help |
Quick summary of flags |
Navigation inside man pages (same as less):
| Key | Action |
|---|---|
q |
Quit |
/pattern |
Search forward |
n / N |
Next / previous match |
Space |
Page down |
b |
Page back |
g / G |
Go to top / bottom |
Man page sections:
| Section | Content | Example |
|---|---|---|
| 1 | User commands | man 1 ls |
| 2 | System calls | man 2 open |
| 3 | C library functions | man 3 printf |
| 5 | File formats | man 5 passwd |
| 8 | Admin commands | man 8 mount |
How It Works
Anatomy of a Man Page
student@ubuntu:~$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
-a, --all do not ignore entries starting with .
-l use a long listing format
...
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
-a, --all do not ignore entries starting with .
-l use a long listing format
...
| Section | What You Find There |
|---|---|
| NAME | Command name + one-line description |
| SYNOPSIS | Usage syntax ([] = optional, ... = repeatable) |
| DESCRIPTION | Full explanation and all flags |
| EXAMPLES | Usage examples (not always present – check here first) |
| SEE ALSO | Related commands |
Discovering Commands
student@ubuntu:~$ man -k copy
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
install (1) - copy files and set attributes
scp (1) - secure copy (remote file copy program)
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
install (1) - copy files and set attributes
scp (1) - secure copy (remote file copy program)
The –help Shortcut
student@ubuntu:~$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs.
-a, --all do not ignore entries starting with .
-l use a long listing format
-h, --human-readable print sizes in human-readable format
...
Usage: ls [OPTION]... [FILE]...
List information about the FILEs.
-a, --all do not ignore entries starting with .
-l use a long listing format
-h, --human-readable print sizes in human-readable format
...
Common Pitfalls
- Stuck in a man page? Press
q. Not Ctrl+C. Not Escape. Justq. man -kreturns nothing? The database may need rebuilding:sudo mandb.- Same name, different thing.
printfis both a shell command (section 1) and a C function (section 3). Useman 3 printfto get the right one. - Reading strategy: Don’t read top-to-bottom. Jump to EXAMPLES first, then SYNOPSIS, then search (
/) for the specific flag you need. --helpvsman: Use--helpwhen you know the command and need a quick flag reminder. Usemanwhen you need the full story.