Getting Help: man, --help, and info
One of the most valuable habits a new Linux user can build is reaching for built-in documentation before searching the web. Nearly every command-line tool ships with some combination of a manual page (accessed via man), a --help flag showing a quick usage summary, and occasionally a more detailed info document. These sources are authoritative for the exact version installed on your machine — unlike a blog post or Stack Overflow answer, they cannot be out of date relative to your system, because they are installed alongside the tool itself.
Cricket analogy: Checking man before searching the web is like consulting the official MCC Laws of Cricket rulebook instead of a fan forum's guess about an obscure LBW scenario — the rulebook can't be outdated for the version of the game actually being played.
man pages
man <command> opens the manual page for that command, formatted and paginated through a pager (usually less). Man pages are organized into numbered sections — section 1 is user commands, section 5 is file formats, section 8 is system administration commands, and so on. This matters because some names exist in multiple sections; for example man 5 passwd shows the file format of /etc/passwd, while man 1 passwd (or just man passwd) shows the command used to change a password. Inside less, you can search forward with /pattern, search backward with ?pattern, jump between matches with n and N, and quit with q.
Cricket analogy: Man pages organized into numbered sections is like a cricket almanac split into 'Laws' (section 1: how to play), 'Ground Regulations' (section 5: pitch specifications), and 'Administration' (section 8: umpiring appointments) — searching the right section matters.
--help and info
Most commands also accept a --help (or sometimes -h) flag that prints a concise summary of options directly to the terminal without invoking a pager — useful for a quick reminder of flag syntax. GNU tools additionally ship info documentation, a hyperlinked, tree-structured format that is often more thorough and tutorial-like than the corresponding man page, particularly for complex tools like tar, sed, and gcc. Navigating info takes a bit of practice: arrow keys move within a page, n/p move to the next/previous node, and q quits.
Cricket analogy: A quick --help flag is like a coach shouting a one-line field-placement reminder before an over ('third man, deep cover, mid-on'), while info-style documents are like a full coaching manual chapter on setting fields for reverse swing.
# man page basics
man ls # open the manual page for ls
man 5 passwd # section 5: file format of /etc/passwd
man -k partition # keyword search across all man page names/descriptions (same as apropos)
whatis grep # one-line description of a command
# --help flag
tar --help | head -30
grep --help
# info documentation
info coreutils 'ls invocation' # jump directly to a specific info node
info tar
# search inside a man page once open (inside less):
# /pattern search forward
# n next match
# q quitThe numbered man sections date back to the original Unix manual and remain standardized today: 1 = user commands, 2 = system calls, 3 = library functions, 4 = special files/devices, 5 = file formats, 6 = games, 7 = miscellaneous/conventions, 8 = system administration commands. man man explains the full list and is worth reading once.
apropos <keyword> (equivalent to man -k) relies on a search database (mandb) that is built periodically or on package install. On a freshly built container image or minimal system, this database may be empty, causing apropos to return nothing even for commands that are installed. Run sudo mandb to rebuild it if searches come up empty unexpectedly.
man <command>opens the authoritative, versioned manual page for a tool, paginated via less.- Man pages are split into numbered sections (1 = commands, 5 = file formats, 8 = admin commands, etc.).
--helpgives a fast, unpaginated summary of flags directly in the terminal.infoprovides hyperlinked, often more tutorial-style documentation for GNU tools.apropos/man -ksearches man page names and descriptions by keyword, but requires a built mandb database.- Built-in documentation is always version-matched to your installed tools, unlike web search results.
Practice what you learned
1. What does `man 5 passwd` show, as opposed to `man 1 passwd`?
2. Which flag typically gives a quick, unpaginated summary of a command's options?
3. What must be built for `apropos`/`man -k` keyword search to return results?
4. Inside a man page opened via less, how do you search forward for a pattern?
5. What advantage do man pages have over a web search result for a given command?
Was this page helpful?
You May Also Like
The Shell and Terminal Explained
Clarifies the difference between the terminal, the terminal emulator, the shell, and the kernel, and introduces Bash as the default command interpreter on most Linux systems.
Navigating the Filesystem (cd, pwd, ls)
Practical mastery of moving around the Linux directory tree using cd, pwd, and ls, including absolute vs relative paths and useful ls flags for everyday work.
Linux & Shell Quick Reference
A condensed cheat sheet consolidating the most frequently used Linux commands, Bash syntax, and shortcuts covered throughout this course for fast lookup.
Linux & Shell Scripting Interview Questions
A curated set of frequently asked Linux and Bash interview questions with model answers, spanning fundamentals, scripting, and troubleshooting scenarios.
Related Reading
Related Study Notes in DevOps
Browse all study notesNginx Study Notes
DevOps · 30 topics
DevOpsAnsible Study Notes
DevOps · 30 topics
DevOpsAdvanced Kubernetes Study Notes
Kubernetes · 30 topics
DevOpsAdvanced Bash Scripting Study Notes
Bash · 30 topics
DevOpsApache Kafka Study Notes
Kafka · 30 topics
DevOpsDocker & Kubernetes Study Notes
YAML · 40 topics