LFCA 13 ๐ง Getting Help โ man, –help, info
Linux has thousands of commands, each with dozens of options. Nobody memorizes them all. Instead, every Linux system ships with its own documentation โ manual pages, --help output, and GNU Info files. Knowing how to find the answer is more valuable than memorizing flags. The LFCA exam expects you to know the three main help systems, how to use them, and how to read a man page. This chapter is about looking things up โ the skill that turns “I don’t know this command” into “I can figure it out.”
Key point: There are three main sources of help on a Linux system: man (manual pages, the standard reference), --help (quick usage summary from the command itself), and info (GNU hypertext documentation). man is the primary tool โ nearly every command has a man page. --help is fast for reminders. info is deeper, but not every program has it. Learn all three, but reach for man first.
Why help matters
Linux has commands, options, and conventions that no one memorizes completely.
The reality of Linux:
- Hundreds of user commands in
/usr/bin - Thousands of options across them
- Different implementations with different flags
- Documentation that’s authoritative for the exact version installed
Three problems help solves:
- “What does this command do?” โ Read the description
- “What options does it take?” โ Read the options section
- “How do I use it for X?” โ Read the examples, or search
Why built-in help is better than memory: Man pages are versioned with the software. They match what’s actually on your system. Online docs might be for a different version. When you need the exact syntax, the man page is authoritative.
Why built-in help is better than search engines: No internet required. Man pages are local. man ls works offline, on a server, in a container. It’s instant.
The three sources:
| Source | Command | Depth | Speed |
|---|---|---|---|
| Man pages | man CMD | Thorough | Fast |
--help | CMD --help | Summary | Instant |
| Info | info CMD | Deep | Slower |
Why the exam tests this: It’s a practical skill. System administrators use help constantly. Knowing how to find the answer is expected, not optional.
Why “RTFM” is bad advice without the M: “Read the manual” is only useful if you can find and read it. The skill isn’t telling people to read the manual โ it’s knowing which manual, how to navigate it, and how to search it. That’s what this chapter teaches.
man โ the manual pages
man displays manual pages. It’s the primary reference for every command, file format, and system call.
$ man ls
This opens the man page for ls in a pager (usually less).
What man pages contain:
| Section | Contents |
|---|---|
| NAME | Command name and one-line description |
| SYNOPSIS | Usage syntax |
| DESCRIPTION | What the command does |
| OPTIONS | Every flag explained |
| FILES | Files the command uses |
| EXAMPLES | Usage examples (not always present) |
| SEE ALSO | Related commands |
| AUTHOR | Who wrote it |
| BUGS | Known issues |
Navigating a man page:
| Key | Action |
|---|---|
| Space or Page Down | Next page |
| b or Page Up | Previous page |
| Enter | Next line |
| Up/Down arrows | Scroll lines |
/pattern | Search forward |
?pattern | Search backward |
n | Next match |
N | Previous match |
g | Go to start |
G | Go to end |
q | Quit |
Why the pager: Man pages are often longer than a screen. The pager (less by default) lets you scroll, search, and quit without losing content. It’s the same navigation as reading a large file.
Searching within a page:
/recursive
Search for “recursive”. Press n to jump to the next match. N goes back.
Reading the SYNOPSIS: The synopsis is a compact usage pattern.
$ man ls | head -20
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
Reading it:
[OPTION]...โ zero or more options[FILE]...โ zero or more fileslsalone lists the current directory
Brackets mean optional. Ellipsis means repeatable. Bold means literal. Italic means replace with a value.
The convention:
| Symbol | Meaning |
|---|---|
command | Literal text |
[OPTION] | Optional |
[OPTION]... | Optional, repeatable |
<FILE> or FILE | Replace with a value |
| `a | b` |
Why the synopsis is dense: It packs the full usage into a few lines. Once you can read it, you know how to call any command.
Why man pages exist: They’re the Unix tradition โ documentation shipped with the software. Before the web, they were the only reference. They remain the authoritative one because they match the installed version. Every serious Linux tool has a man page.
Man page sections
Man pages are organized into numbered sections, each covering a different kind of documentation.
| Section | Contents |
|---|---|
| 1 | User commands |
| 2 | System calls |
| 3 | Library functions |
| 4 | Special files (devices) |
| 5 | File formats and conventions |
| 6 | Games |
| 7 | Miscellaneous (conventions, protocols) |
| 8 | System administration commands |
| 9 | Kernel routines |
Common sections you’ll use:
- 1 โ commands you type (
ls,grep,cp) - 5 โ file formats (
/etc/passwd,/etc/fstab) - 8 โ admin commands (
mount,fdisk,systemctl)
Examples:
$ man 1 ls # user command
$ man 5 passwd # file format
$ man 8 mount # admin command
$ man 3 printf # C library function
Why sections matter: Some names exist in multiple sections. passwd is both a command (section 1) and a file format (section 5). printf is both a shell built-in (section 1) and a C function (section 3). Specifying the section gets you the right page.
What happens without a section:
$ man passwd
Shows the first match โ usually section 1 (the command). If you want the file format, specify section 5.
Listing all sections for a name:
$ man -a printf
-a shows all pages for the name, one after another.
What’s on the system:
$ man -k .
Lists every man page. Or:
$ whatis ls
ls (1) - list directory contents
whatis gives the short description from a man page.
Why numbered sections: They separate documentation by audience and purpose. A user reading man ls doesn’t care about the C source. A programmer reading man 3 printf wants the API. The sections keep each audience’s docs together.
Why section 5 exists: File formats need documentation too.
/etc/passwd,/etc/fstab,/etc/hostsโ each has a specific format. The man page forpasswdin section 5 describes it. Section 5 is where you look when a config file’s syntax isn’t obvious.
Searching man pages
Two tools find the right man page: whatis and apropos.
whatis โ quick description:
$ whatis ls
ls (1) - list directory contents
$ whatis grep
grep (1) - print lines that match patterns
Shows the one-line description from the man page.
apropos โ keyword search:
$ apropos "list directory"
ls (1) - list directory contents
$ apropos "copy"
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
dd (1) - convert and copy a file
Searches the NAME and description fields of all man pages for a keyword.
man -k โ same as apropos:
$ man -k "directory"
man -k and apropos are equivalent. Both search the same database.
The whatis database: Both commands query a pre-built index. On some systems it must be built:
$ sudo mandb
mandb builds or updates the database. Without it, apropos finds nothing.
Refining a search:
$ apropos -e "exact phrase"
$ apropos ^log # names starting with log
$ apropos log$ # names ending with log
apropos accepts a regex. Useful when the keyword is too broad.
Examples:
$ apropos "password"
passwd (1) - change user password
passwd (5) - the password file
shadow (5) - shadowed password file
openssl-passwd (1) - compute password hashes
$ apropos "network"
ip (8) - show / manipulate routing, network devices
ss (8) - another utility to investigate sockets
...
Why search matters: You often know what you want to do โ “copy files”, “see network” โ but not which command does it. apropos bridges from intent to command name.
When apropos finds nothing: The database isn’t built, or the keyword doesn’t appear in any description. Try man -k, or a different keyword. Run sudo mandb if the database seems stale.
Why
aproposis underused: It’s the fastest way to answer “which command does X?” New users search the web; experienced users runapropos. The man page for the command you didn’t know you needed is one command away.
--help โ quick usage
Most commands accept --help and print a usage summary. It’s faster than a man page and works even when man isn’t installed.
$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
...
Why --help is useful:
- Instant โ no pager, no scrolling
- Compact โ only the usage and options
- Available โ works even on minimal systems
- Exact โ matches the installed version
What --help includes:
- Usage line
- Short description
- Option list with descriptions
- Sometimes examples
What it doesn’t include:
- Detailed explanation
- File formats
- Related commands
- Examples (usually)
The difference from man:
| Aspect | --help | man |
|---|---|---|
| Speed | Instant | Fast |
| Length | Summary | Detailed |
| Structure | Flat list | Sections |
| Searchable | Not usually | Yes (/pattern) |
| Includes synopsis | Short | Full |
| Available on all commands | Most GNU | Nearly all |
Not all commands support --help: Some use -h, some use help, some have neither. The convention is --help for GNU tools, but not every tool follows it.
Common alternatives:
| Command | Help form |
|---|---|
| GNU tools | --help |
| Many BSD tools | -h or none |
| Bash built-ins | help CMD |
| Some apps | -? |
Bash built-ins:
$ help cd
cd: cd [-L|[-P [-e]] [-@]] [dir]
Change the shell working directory.
...
help is the shell’s built-in for its own commands. man cd might show a different cd (the program, not the built-in).
Why --help matters for scripts: When you’re working on a minimal system, or when man pages aren’t installed, --help still works. It’s the bare minimum every command provides.
Why
--helpis a convention, not a rule: There’s no standard that requires--help. GNU tools follow it. Others may not. When it doesn’t work, try-h,help, or read the man page. The convention is widespread because it’s useful โ but it’s still a convention.
info โ GNU documentation
info reads GNU Info files โ hypertext documentation with links, menus, and cross-references.
$ info ls
This opens the Info reader for ls if an Info file exists.
What Info is:
- A documentation format
- Hyperlinked like the web
- Structured with menus
- Deeper than man pages for GNU tools
Navigation:
| Key | Action |
|---|---|
| Space | Next page |
| Backspace | Previous page |
| n | Next node |
| p | Previous node |
| u | Up to parent node |
| m | Follow menu item |
| f | Follow link |
| l | Go back |
| q | Quit |
Structure: Info files are organized as a tree of nodes โ a top node, chapters, sections, and leaves. Each node has links to related nodes.
What Info has that man doesn’t:
- Longer, more detailed descriptions
- Tutorials and examples
- Cross-references between nodes
- Multiple documents linked together
What Info doesn’t have:
- Universal coverage โ not every command has an Info file
- Familiar navigation for people used to
less - The simplicity of
man
When to use info: When man isn’t enough and you need deeper documentation. GNU tools often have Info files; many non-GNU tools don’t.
The info command:
$ info # top-level menu
$ info ls # specific command
$ info coreutils # a whole package
Why Info exists: The GNU project found man pages limiting. Info lets authors write longer, linked documentation. For tools like gcc, emacs, and coreutils, the Info files are the authoritative reference.
Reading Info in a pager:
$ info --output=- ls | less
--output=- writes to stdout instead of the interactive reader. Useful for piping.
Why Info is often ignored: The navigation is different from less. Man pages are simpler. Many users never need the extra depth. But for GNU tools, Info is where the complete documentation lives.
Why “info” and not “man2”: Man pages were designed before hypertext. Info was the GNU project’s answer โ structured, linked, hierarchical documentation. It’s a different format with a different philosophy. Both exist; both are useful for different cases.
Reading a man page
A man page has a standard structure. Knowing the sections makes it fast to find what you need.
The typical layout:
NAME
command - one-line description
SYNOPSIS
command [OPTION]... [ARGUMENT]...
DESCRIPTION
Detailed explanation of what the command does.
OPTIONS
-a, --all description
-b, --binary description
...
FILES
/path/to/file description
SEE ALSO
related(1), other(8)
AUTHOR
Who wrote it.
Fast reading strategy:
- NAME โ confirm you have the right page
- SYNOPSIS โ see the usage shape
- OPTIONS โ find the flag you need
- EXAMPLES โ if present, copy and adapt
- SEE ALSO โ related commands
Searching:
$ man ls
/recursive
Press /, type the term, press Enter. Press n for next match.
Reading a specific section:
$ man 5 fstab
Shows the file format documentation for /etc/fstab.
Saving a man page:
$ man ls > ls-manual.txt
Or:
$ man ls | col -b > ls-manual.txt
col -b strips backspace characters used for bold/underline in the terminal.
Printing a man page:
$ man ls | col -b | lpr
The MANPATH: The search path for man pages.
$ echo $MANPATH
Usually set to /usr/share/man:/usr/local/share/man. Each directory holds man pages organized by section:
/usr/share/man/man1/ls.1
/usr/share/man/man5/passwd.5
/usr/share/man/man8/mount.8
Why the section suffix: The file name ends with the section number. That’s how man finds the right page for a given section.
Common reading patterns:
| Need | Action |
|---|---|
| Quick description | Read NAME |
| Usage syntax | Read SYNOPSIS |
| Specific flag | Search /flag |
| Examples | Jump to EXAMPLES |
| Related commands | Read SEE ALSO |
Why the structure is consistent: Man pages use the same section headers everywhere. Once you know the structure, you know where to look on any page. Consistency is what makes them fast to read.
Why SYNOPSIS is the most valuable section: It’s the whole usage of the command in a few lines. For most tasks, reading it and the NAME is enough. The DESCRIPTION and OPTIONS fill in details, but the synopsis answers “how do I call this?”
A full example
Using help systems to learn an unfamiliar command.
# ============================================
# PART 1: I NEED A COMMAND THAT DOES SOMETHING
# ============================================
# Search for commands related to disk usage
apropos "disk usage"
# df (1) - report file system disk space usage
# du (1) - estimate file space usage
# du (1) - estimate file space usage
# ...
# ============================================
# PART 2: GET QUICK INFO
# ============================================
whatis df
# df (1) - report file system disk space usage
whatis du
# du (1) - estimate file space usage
# ============================================
# PART 3: READ THE MAN PAGE
# ============================================
man du
# DU(1) User Commands DU(1)
#
# NAME
# du - estimate file space usage
#
# SYNOPSIS
# du [OPTION]... [FILE]...
# du [OPTION]... --files0-from=F
#
# DESCRIPTION
# Summarize disk usage of the set of FILEs, recursively for
# directories.
# ...
# Search within the man page
# Press / then type "human"
# -h, --human-readable
# print sizes in human readable format (e.g., 1K 234M 2G)
# Press q to quit
# ============================================
# PART 4: TRY --help
# ============================================
du --help
# Usage: du [OPTION]... [FILE]...
# or: du [OPTION]... --files0-from=F
# Summarize disk usage of the set of FILEs, recursively for directories.
#
# Mandatory arguments to long options are mandatory for short options too.
# -a, --all write counts for all files, not just directories
# --apparent-size print apparent sizes, rather than disk usage
# -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
# -s, --summarize display only a total for each argument
# ...
# ============================================
# PART 5: USE THE COMMAND
# ============================================
du -sh /var/log
# 2.1G /var/log
du -sh /var/log/*
# 12M /var/log/apt
# 500M /var/log/journal
# ...
# ============================================
# PART 6: CHECK INFO FOR DEEPER DOCS
# ============================================
info du 2>/dev/null || echo "No info page"
# (opens Info if available)
# q to quit
# ============================================
# PART 7: SEARCH FOR MORE
# ============================================
apropos "human readable"
# du (1) - estimate file space usage
# ls (1) - list directory contents
# df (1) - report file system disk space usage
# ...
# ============================================
# PART 8: LOOK UP A FILE FORMAT
# ============================================
man 5 fstab
# FSTAB(5) File Formats Manual FSTAB(5)
#
# NAME
# fstab - static information about the filesystems
#
# DESCRIPTION
# The file fstab contains descriptive information about the
# various file systems the system can mount.
# ...
# ============================================
# PART 9: THE WHATIS DATABASE
# ============================================
# If apropos finds nothing, rebuild the database
sudo mandb
# Then retry
apropos "editor"
# nano (1) - Nano's ANOther editor
# vi (1) - the standard text editor
# vim (1) - Vi IMproved, a programmer's text editor
# ...
# ============================================
# PART 10: BASH BUILT-IN HELP
# ============================================
help cd
# cd: cd [-L|[-P [-e]] [-@]] [dir]
# Change the shell working directory.
#
# Change the current directory to DIR. The default DIR is the value
# of the HOME shell variable.
# ...
# man cd might show a different cd
man cd
# CD(1) User Commands CD(1)
# (this is the program, not the built-in)
Every part demonstrates a different help tool. Together they cover finding, reading, and using documentation.
Why this session: It walks through the real workflow โ discover a command with
apropos, get a quick description withwhatis, read the man page for details, use--helpfor a quick reminder, and reach forinfowhen deeper docs exist. That’s the full toolkit.
Complete Example Session
# ============================================
# PART 1: WHAT DOES THIS COMMAND DO?
# ============================================
whatis grep
# [ grep (1) - print lines that match patterns ]
man grep | head -20
# [ GREP(1) General Commands Manual GREP(1) ]
# [
# [ NAME
# [ grep, egrep, fgrep - print lines that match patterns
# [
# [ SYNOPSIS
# [ grep [OPTION...] PATTERNS [FILE...]
# [ ...
# ============================================
# PART 2: --help QUICK CHECK
# ============================================
grep --help | head -15
# [ Usage: grep [OPTION]... PATTERNS [FILE]... ]
# [ Search for PATTERNS in each FILE. ]
# [ ...
# [ -i, --ignore-case ignore case distinctions ]
# [ -v, --invert-match select non-matching lines ]
# ============================================
# PART 3: SEARCH IN MAN PAGE
# ============================================
man grep
# /recursive
# (search for "recursive" โ found as -r)
# q to quit
# ============================================
# PART 4: APPROPOS
# ============================================
apropos "search text"
# [ grep (1) - print lines that match patterns ]
# [ egrep (1) - print lines that match patterns ]
# [ fgrep (1) - print lines that match patterns ]
# [ agrep (1) - search a file for a string or regular expression ]
# ============================================
# PART 5: MAN SECTIONS
# ============================================
man -k "password"
# [ passwd (1) - change user password ]
# [ passwd (5) - the password file ]
# [ shadow (5) - shadowed password file ]
man 5 passwd | head -30
# [ PASSWD(5) File Formats Manual PASSWD(5) ]
# [
# [ NAME
# [ passwd - the password file
# [
# [ DESCRIPTION
# [ /etc/passwd contains one line for each user account
# [ ...
# ============================================
# PART 6: MAN SECTION 1 VS 8
# ============================================
whatis mount
# [ mount (8) - mount a filesystem ]
man 8 mount | head -20
# [ MOUNT(8) System Administration MOUNT(8) ]
# [
# [ NAME
# [ mount - mount a filesystem
# ...
# ============================================
# PART 7: BASH BUILT-IN HELP
# ============================================
type cd
# [ cd is a shell builtin ]
help cd
# [ cd: cd [-L|[-P [-e]] [-@]] [dir] ]
# [ Change the shell working directory. ]
# [ ... ]
# ============================================
# PART 8: INFO
# ============================================
info coreutils 2>/dev/null || echo "info not available"
# (interactive Info reader opens)
# q to quit
# ============================================
# PART 9: REBUILD WHATIS DATABASE
# ============================================
sudo mandb
# [ ... rebuilding man-db ... ]
apropos "compression"
# [ gzip (1) - compress or expand files ]
# [ tar (1) - an archiving utility ]
# [ bzip2 (1) - a block-sorting file compressor ]
# [ xz (1) - Compress or decompress .xz and .lzma files ]
# ============================================
# PART 10: SAVE MAN PAGE
# ============================================
man ls | col -b > /tmp/ls-manual.txt
wc -l /tmp/ls-manual.txt
# [ (number of lines) ]
# ============================================
# PART 11: PATTERN SEARCH
# ============================================
man grep
# /--context
# n (next match)
# (see the -C option)
# q to quit
# ============================================
# PART 12: SUMMARY COMMANDS
# ============================================
whatis ls cp mv rm
# [ ls (1) - list directory contents ]
# [ cp (1) - copy files and directories ]
# [ mv (1) - move (rename) files ]
# [ rm (1) - remove files or directories ]
apropos "copy file"
# [ cp (1) - copy files and directories ]
# [ install (1) - copy files and set attributes ]
# [ scp (1) - secure copy (remote file copy program) ]
# [ rsync (1) - a fast, versatile, remote (and local) file-copying tool ]
Every part exercises a help tool. Together they cover the workflow of finding documentation.
Quick Reference
The Three Help Systems
| Tool | Command | Purpose |
|---|---|---|
| Man | man CMD | Full reference |
| Help | CMD --help | Quick summary |
| Info | info CMD | Deep GNU docs |
man Flags
| Flag | Effect |
|---|---|
man CMD | Open man page |
man N CMD | Open section N |
man -k WORD | Search descriptions |
man -a CMD | All sections |
man -w CMD | Show path to man page |
man -f CMD | Same as whatis |
Man Sections
| Section | Contents |
|---|---|
| 1 | User commands |
| 2 | System calls |
| 3 | Library functions |
| 4 | Special files |
| 5 | File formats |
| 6 | Games |
| 7 | Miscellaneous |
| 8 | Admin commands |
| 9 | Kernel routines |
Pager Navigation
| Key | Action |
|---|---|
| Space | Next page |
| b | Previous page |
| Enter | Next line |
/pattern | Search forward |
?pattern | Search backward |
n | Next match |
N | Previous match |
g | Top |
G | Bottom |
q | Quit |
SYNOPSIS Symbols
| Symbol | Meaning |
|---|---|
[ ] | Optional |
... | Repeatable |
a | b | Either |
bold | Literal |
italic | Replace |
Man Page Sections
| Section | Contains |
|---|---|
| NAME | Command + one-liner |
| SYNOPSIS | Usage |
| DESCRIPTION | What it does |
| OPTIONS | Flags |
| FILES | Files used |
| EXAMPLES | Usage |
| SEE ALSO | Related |
| AUTHOR | Who wrote it |
| BUGS | Known issues |
Search Commands
| Command | Purpose |
|---|---|
whatis CMD | One-line description |
apropos WORD | Search descriptions |
man -k WORD | Same as apropos |
mandb | Rebuild database |
--help Options
| Form | Works on |
|---|---|
CMD --help | GNU tools |
CMD -h | Many tools |
help CMD | Bash built-ins |
CMD -? | Some tools |
info Navigation
| Key | Action |
|---|---|
| Space | Next page |
| n | Next node |
| p | Previous node |
| u | Up to parent |
| m | Menu item |
| f | Follow link |
| l | Go back |
| q | Quit |
Where Man Pages Live
| Path | Section |
|---|---|
/usr/share/man/man1/ | User commands |
/usr/share/man/man5/ | File formats |
/usr/share/man/man8/ | Admin commands |
/usr/local/share/man/ | Local installs |
Common Reading Patterns
| Need | Action |
|---|---|
| What does it do? | Read NAME |
| How to use it? | Read SYNOPSIS |
| Specific flag? | Search /flag |
| Examples? | Jump to EXAMPLES |
| Related tools? | Read SEE ALSO |
Same Name, Different Sections
| Name | Section 1 | Section 5 |
|---|---|---|
| passwd | Command to change password | Password file format |
| fstab | โ | Filesystem mount file |
| hosts | โ | Hostname resolution file |
| printf | Shell built-in | โ |
| mount | โ | Admin command (section 8) |
Save and Print
| Task | Command |
|---|---|
| Save | man CMD > file.txt |
| Strip formatting | man CMD | col -b > file.txt |
man CMD | col -b | lpr | |
| Read in editor | man CMD | col -b | vim - |
Environment Variables
| Variable | Meaning |
|---|---|
$MANPATH | Search path for man pages |
$PAGER | Program used to display |
$LESS | Options for less |
$MANWIDTH | Line width for man output |
When to Use Which
| Situation | Use |
|---|---|
| Learning a new command | man |
| Quick reminder | --help |
| Finding a command | apropos |
| Identifying a command | whatis |
| Deep GNU docs | info |
| Bash built-in | help |
| File format | man 5 |
| Admin command | man 8 |
Common Errors
| Error | Cause | Fix |
|---|---|---|
No manual entry | No man page | Try --help |
apropos: nothing appropriate | DB not built | sudo mandb |
info: No menu item | No Info file | Use man |
| Wrong section shown | Ambiguous name | Specify number |
| Garbled output | Terminal issues | col -b |
What’s the Difference
| Feature | man | --help | info |
|---|---|---|---|
| Depth | Deep | Summary | Deepest |
| Speed | Fast | Instant | Slower |
| Navigation | Pager | None | Info reader |
| Search | โ | โ | โ |
| Coverage | Universal | Most | GNU |
| Structure | Sections | Flat list | Hypertext |
Best Practices
โ Do This:
# Start with man for any unfamiliar command
man rsync # โ
# Use apropos when you don't know the command
apropos "copy files" # โ
# Use whatis for a quick description
whatis tar # โ
# Use --help for a fast reminder
tar --help # โ
# Search inside a man page
man rsync
/recursive # โ
# Specify the section when needed
man 5 crontab # โ
# Use help for bash built-ins
help cd # โ
# Rebuild the whatis database if empty
sudo mandb # โ
# Read EXAMPLES if present
man rsync | grep -A20 EXAMPLES # โ
# Save a man page
man iptables | col -b > iptables.txt # โ
โ Don’t Do This:
# Don't guess flags
command -z # what does -z do? # โ ๏ธ
# Don't read the entire man page for one flag
man ls # then scroll forever # โ ๏ธ
# Don't ignore man sections
man passwd # which passwd? # โ ๏ธ
# Don't skip --help for a quick check
man verylongcommand # use --help first # โ ๏ธ
# Don't forget bash has its own help
man cd # shows the program, not the built-in # โ ๏ธ
# Don't parse man pages for options
man ls | grep -- # โ ๏ธ
# Don't assume info exists
info rm # may not exist # โ ๏ธ
# Don't ignore SEE ALSO
# It lists related commands you might need # โ ๏ธ
# Don't run apropos without building the database
apropos x # may return nothing # โ ๏ธ
Common Pitfalls
| Pitfall | Problem | Solution |
|---|---|---|
| Wrong man section | Wrong page | Specify the number |
| Missing man page | No docs | Try --help |
apropos finds nothing | DB not built | sudo mandb |
| Skipping SYNOPSIS | Missed usage | Read it first |
| Ignoring EXAMPLES | Reinventing | Read them |
man cd shows program | Not built-in | Use help cd |
| Pager confusion | Can’t exit | Press q |
| Long output | Overwhelming | Search with / |
No --help | Missing | Try -h or man |
info not installed | No GNU docs | Use man |
Real-World Examples
1. Read a command’s man page
man ls
2. Get a quick description
whatis grep
3. Search for a command
apropos "compress file"
4. Specific man section
man 5 passwd
5. Search within a man page
man tar
/human
6. Quick usage summary
tar --help
7. Bash built-in help
help cd
8. All man pages for a name
man -a printf
9. Rebuild man database
sudo mandb
10. Find man page path
man -w ls
11. Read Info docs
info coreutils
12. Save a man page
man iptables | col -b > rules-doc.txt
13. Find all commands in a section
man -s 1 -k . | wc -l
14. Check if man page exists
man -w nonexistent # returns non-zero if missing
15. Search all sections
apropos "sockets"
16. Read file format docs
man 5 hosts
17. Read admin command docs
man 8 systemctl
18. Follow SEE ALSO
man grep
# SEE ALSO: egrep(1), fgrep(1), rgrep(1)
19. Browse man in an editor
man ls | col -b | vim -
20. Learn a command quickly
# NAME + SYNOPSIS + first of OPTIONS
man rsync | head -40
Visual: The Help Systems
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ man โ
โ โ Full reference โ
โ โ Sections โ
โ โ Searchable โ
โ โ Universal coverage โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ --help โ
โ โ Quick usage โ
โ โ Instant โ
โ โ No pager โ
โ โ Most GNU tools โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ info โ
โ โ Hypertext โ
โ โ Deepest docs โ
โ โ GNU tools โ
โ โ Menu-based navigation โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: man Page Structure
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NAME โ
โ โ command - one line โ
โ โ
โ SYNOPSIS โ
โ โ command [OPTIONS] [ARGS] โ
โ โ
โ DESCRIPTION โ
โ โ detailed explanation โ
โ โ
โ OPTIONS โ
โ โ flag description โ
โ โ flag description โ
โ โ
โ FILES โ
โ โ /path purpose โ
โ โ
โ SEE ALSO โ
โ โ related(1), other(8) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: Man Sections
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1 User commands ls, cp, grep โ
โ 2 System calls open, read, write โ
โ 3 Library functions printf, malloc โ
โ 4 Special files /dev/* โ
โ 5 File formats passwd, fstab โ
โ 6 Games โ
โ 7 Miscellaneous conventions โ
โ 8 Admin commands mount, fdisk โ
โ 9 Kernel routines โ
โ โ
โ Most common: 1, 5, 8 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: SYNOPSIS Reading
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ls [OPTION]... [FILE]... โ
โ โโฌ โโโโโโโโโฌโ โโโโโโฌโ โ
โ โ โ โ โ
โ โ โ โ zero or more files โ
โ โ โ โ
โ โ โ zero or more options โ
โ โ โ
โ โ command name โ
โ โ
โ [ ] = optional โ
โ ... = repeatable โ
โ | = either โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ cp [OPTION]... SOURCE... DEST โ
โ โโฌ โโโโโโโโโฌโ โโโโโโฌโ โโโโโ โ
โ โ โ โ โ โ
โ โ โ โ โ destination โ
โ โ โ โ one or more sources โ
โ โ โ options โ
โ โ command โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: apropos Workflow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ "I want to copy files" โ
โ โ โ
โ โผ โ
โ apropos "copy" โ
โ โ โ
โ โผ โ
โ cp (1) - copy files and directories โ
โ rsync (1) - fast, versatile copy โ
โ scp (1) - secure copy โ
โ dd (1) - convert and copy a file โ
โ โ โ
โ โผ โ
โ man cp โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: Searching in man
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ $ man tar โ
โ โ
โ (inside pager) โ
โ /human-readable โ
โ โ โ
โ โผ โ
โ [match highlighted] โ
โ โ
โ n โ next match โ
โ N โ previous match โ
โ โ
โ q โ quit โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: man vs –help vs info
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ man CMD โ
โ โโโโโโโโโโโโโโโบ detailed page โ
โ โโโโโโโโโโโโโโโบ sections โ
โ โโโโโโโโโโโโโโโบ searchable โ
โ โ
โ CMD --help โ
โ โโโโโโโโโโโโโโโบ quick summary โ
โ โโโโโโโโโโโโโโโบ flat list โ
โ โโโโโโโโโโโโโโโบ instant โ
โ โ
โ info CMD โ
โ โโโโโโโโโโโโโโโบ hypertext โ
โ โโโโโโโโโโโโโโโบ menus and links โ
โ โโโโโโโโโโโโโโโบ deepest โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: man Page Sources
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ $ man -w ls โ
โ /usr/share/man/man1/ls.1.gz โ
โ โ
โ Path structure: โ
โ /usr/share/man/ โ
โ โโโ man1/ โ
โ โโโ ls.1.gz โ compressed source โ
โ โ
โ man decompresses and displays โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: When apropos Finds Nothing
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ $ apropos "obscure thing" โ
โ obscure thing: nothing appropriate โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Possible causes: โ
โ โ
โ 1. Database not built โ
โ 2. Keyword not in any description โ
โ 3. Man pages not installed โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fix: โ
โ $ sudo mandb โ
โ (rebuilds the whatis database) โ
โ โ
โ Then retry โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Visual: Decision Flow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Need to know which command does X? โ
โ โโโ apropos "X" โ
โ โ
โ Need one-line description? โ
โ โโโ whatis CMD โ
โ โ
โ Need full docs? โ
โ โโโ man CMD โ
โ โ
โ Need a quick reminder? โ
โ โโโ CMD --help โ
โ โ
โ Need file format docs? โ
โ โโโ man 5 FILE โ
โ โ
โ Need admin command docs? โ
โ โโโ man 8 CMD โ
โ โ
โ Need bash built-in docs? โ
โ โโโ help CMD โ
โ โ
โ Need GNU deep docs? โ
โ โโโ info CMD โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Tool | Command | Purpose |
|---|---|---|
man | man CMD | Manual pages โ full reference |
man N | man 5 passwd | Specific section |
apropos | apropos WORD | Search descriptions |
whatis | whatis CMD | One-line description |
--help | CMD --help | Quick usage |
help | help CMD | Bash built-ins |
info | info CMD | GNU hypertext docs |
mandb | sudo mandb | Rebuild whatis DB |
Key takeaways:
manis the primary reference โ nearly every command has a man page- Man pages are organized into sections โ 1 for commands, 5 for file formats, 8 for admin
man 5 fstabโ specify the section when the name is ambiguouswhatis CMDgives a one-line descriptionapropos WORDsearches all man page descriptions for a keywordman -k WORDis the same asapropossudo mandbrebuilds the search database ifaproposfinds nothingCMD --helpprints a quick usage summary โ faster than a man pagehelp CMDis for bash built-ins โman cdshows a different programinfo CMDopens GNU hypertext documentation โ deeper than man- SYNOPSIS uses
[ ]for optional,...for repeatable,|for either - Pager keys โ Space next,
bprevious,/search,nnext match,qquit man CMD | col -b > filesaves a formatted man page- Man pages match the installed version โ always accurate for your system
Remember: Nobody memorizes every command and flag. The skill is knowing how to find the answer. man is the reference โ full, searchable, versioned. --help is the quick reminder. info is the deep dive. apropos bridges from intent to command. When you don’t know, look it up. That’s not a weakness โ it’s the professional habit. The exam tests it because every Linux admin uses it daily.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!