student@ubuntu:~$
shell 1/5 15 XP

Manual Pages

0%

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

Terminal
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
...
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

Terminal
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)

The –help Shortcut

Terminal
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
...

Common Pitfalls

  • Stuck in a man page? Press q. Not Ctrl+C. Not Escape. Just q.
  • man -k returns nothing? The database may need rebuilding: sudo mandb.
  • Same name, different thing. printf is both a shell command (section 1) and a C function (section 3). Use man 3 printf to 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.
  • --help vs man: Use --help when you know the command and need a quick flag reminder. Use man when you need the full story.

Unlocks

Complete this skill to see what it unlocks.