Chapter 16: Bash Manual (man)

What is man? (super simple first)

man = manual It opens the official built-in documentation (called “man page”) for almost any command, function, file format, or system call in Linux.

Think of it as the help book that lives inside your terminal — no internet needed!

Most powerful thing: every good Linux command has a man page. Even man itself has one — that’s how you learn how to use it!

1. Basic usage (start here)

Bash

What happens?

  • Terminal clears and shows a long text document
  • You are now inside a pager (usually less program)
  • It shows detailed info about the command

2. Typical structure of a man page (very important — memorize this pattern)

Almost every man page has these sections (in this order):

text

Pro tip from experienced users: When you open a man page → immediately scroll to EXAMPLES section — most people learn fastest from examples.

3. How to move around inside man page (navigation keys — learn these!)

You are inside less (or sometimes more), so use these keys:

Key / Combination What it does Very useful when…
↑ / ↓ or j / k Scroll line by line Reading slowly
Space / Page Down Next page Skip quickly
b / Page Up Previous page Go back
/something Search forward for “something” Find -r option fast
?something Search backward
n Next search result After / or ?
N Previous search result
g Go to top of page Start over
G Go to bottom of page Jump to EXAMPLES or SEE ALSO
q Quit / exit man page Finish reading
h Show help (all keys) Forgot something? Press h

Real trick — to jump straight to EXAMPLES:

  1. Open man ls
  2. Press G (capital G) → go to end
  3. Press ?EXAMPLES then Enter → search backward for “EXAMPLES”
  4. Or just /EXAMPLES and n/n until you find it

4. Most useful options for man itself

Bash

Common useful flags:

Bash

5. The 9 main sections of man pages (very useful knowledge)

Linux organizes man pages into numbered sections:

Section What it contains When you need it Example command
1 Executable programs / commands Everyday commands (99% of time) man 1 ls or just man ls
2 System calls (kernel functions) C programming, low-level man 2 fork
3 Library functions (C libs) Programming man 3 printf
4 Special files (/dev devices) Hardware stuff man 4 tty
5 File formats & configs Config files like /etc/passwd man 5 crontab
6 Games Fun stuff man 6 tetris (if installed)
7 Miscellaneous (protocols, macros, etc.) Weird extras man 7 regex
8 System admin commands & daemons root / server stuff man 8 iptables
9 Kernel routines (not common) Very advanced Rarely used

Real example why sections matter:

Bash

6. Real-life examples you should try now

Bash

7. Quick cheat-sheet table

What you want Command you type Why it’s useful
Read manual for command man ls Main way
Learn about man itself man man Start here!
Search for keyword man -k directory Find unknown commands
Jump to examples Inside man: G then /EXAMPLES Fastest learning
Specific section man 5 crontab Config files
All versions of same name man -a printf See builtin vs library
One-line summary whatis ls or man -f ls Quick check
Search inside man page /–color then n Find specific option

8. Bonus tips (what pros do)

  • First time? → man man then man intro (great beginner intro!)
  • Stuck? Press h inside man for help
  • Prefer shorter help? Many commands have –help (faster than man)
  • Want colorful man pages? Add to ~/.bashrc:
    Bash
  • Offline forever — man pages are local!

Now open your terminal and try:

Bash

Then tell me: did you find the EXAMPLES section? Or ask me: “how to search for all commands about files?” or “show me man page for bash loops” — I’ll guide you with exact steps! 😄

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *