LFCS 8 ๐ง Getting Help โ man, –help, info
The LFCS allows access to documentation. Every system has it, and every task on the exam can be completed with it. The man command is the primary interface to the documentation on a Linux system. The --help flag is the quick summary. The info command is the alternative hypertext format. Knowing how to find the answer is more valuable than memorizing the answer, because the exam rewards the ability to look things up under time pressure.
Key point: man displays a command’s manual page, which contains the full documentation: name, synopsis, description, options, files, and see-also. The --help flag prints a short usage summary. info displays the GNU documentation in a navigable hypertext format. The man command has sections, and a command may have pages in more than one section. The apropos and whatis commands search the manual page database.
Why getting help matters
The exam problem. The LFCS is performance-based and allows documentation. The exam environment has man pages installed. A candidate who knows how to find the right option for lvcreate is not disadvantaged by not having memorized it. A candidate who does not know how to search the documentation is.
The memorization problem. Linux has thousands of commands, each with dozens of options. No one memorizes all of them. The skill is knowing which command to use and how to find its options. The man page is the answer, and knowing how to read one is a core competency.
The distribution problem. The exam is distribution-independent, but the commands differ. A man page on Ubuntu and a man page on CentOS document the same command differently in some cases. Reading the page on the system you are using is the reliable approach.
The update problem. Commands change. Options are added and deprecated. The man page on the system reflects the version of the command that is installed. The online documentation may be for a different version. The local man page is the authoritative source for the installed software.
The scripting problem. A script that uses a command’s option needs to know the option exists in the installed version. The man page confirms it. The --help flag is even faster for checking a specific option.
a. The man command
The man command displays a manual page. The argument is the name of a command, a file, a system call, or a library function.
$ man ls
The page opens in a pager, usually less. The navigation keys are the same as less: space for the next page, b for the previous page, / for search, n for the next search match, and q to quit.
The structure of a manual page is consistent.
| Section | Content |
|---|---|
| NAME | Command name and one-line description |
| SYNOPSIS | Usage syntax |
| DESCRIPTION | Detailed description |
| OPTIONS | Option flags |
| FILES | Files the command uses |
| EXAMPLES | Usage examples (if present) |
| SEE ALSO | Related commands |
The SYNOPSIS uses conventions that are worth knowing.
| Convention | Meaning |
|---|---|
bold | Type as written |
italic | Replace with a value |
[-abc] | Optional flags |
-a|-b | Either -a or -b |
... | Repeatable |
SYNOPSIS
ls [OPTION]... [FILE]...
The ls command takes options and files, both optional and repeatable. The brackets indicate optional. The ... indicates that the argument can be repeated.
The man command has options of its own.
| Option | Effect |
|---|---|
-k | Search by keyword (same as apropos) |
-f | Short description (same as whatis) |
-a | Show all matching pages |
-w | Show the path to the page |
-K | Search all pages for a string |
$ man -k "copy file"
$ man -f ls
$ man -a passwd
$ man -w ls
$ man -K "recursive copy"
The man -k searches the manual page descriptions for a keyword. It is the same as apropos. The man -f prints the short description. It is the same as whatis. The man -a shows all pages with the same name in different sections. The man -w shows the path to the page file. The man -K searches the full text of all pages.
b. Manual sections
The manual is divided into sections. A command can have a page in more than one section. The man command uses the first page it finds, but the section can be specified.
| Section | Content |
|---|---|
| 1 | User commands |
| 2 | System calls |
| 3 | Library functions |
| 4 | Special files (devices) |
| 5 | File formats and conventions |
| 6 | Games |
| 7 | Miscellaneous |
| 8 | System administration commands |
| 9 | Kernel routines |
$ man 1 ls # user command
$ man 5 passwd # file format
$ man 8 mount # system administration
The passwd command has two pages: one in section 1 for the user command and one in section 5 for the file format. man passwd shows the section 1 page. man 5 passwd shows the file format page. The same is true for mount, which has pages in sections 2, 5, and 8.
The section can be inferred from the content. A command that changes the system is in section 8. A file format is in section 5. A system call is in section 2. When the page you get is not the page you want, the section is the likely cause.
The man -a option shows all pages with the same name in sequence.
$ man -a passwd
The first page is displayed, and pressing q continues to the next page. This is useful when the section is not known.
The whatis command shows the short description of a command and the section it is in.
$ whatis passwd
passwd (1) - change user password
passwd (5) - the password file
The output lists the command, the section in parentheses, and the description. The section tells you which page to read.
The apropos command searches the descriptions for a keyword. It is the tool to use when the command name is not known.
$ apropos copy
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
dd (1) - convert and copy a file
rsync (1) - a fast, versatile, remote (and local) file-copying tool
scp (1) - secure copy (remote file copy program)
The output lists the commands, their sections, and their descriptions. The apropos search is case-insensitive by default.
The man -k and apropos commands are equivalent. They search the same database. The database is generated by mandb or makewhatis.
c. The –help flag and info
The --help flag prints a short usage summary. It is faster than a man page and is often the first thing to try.
$ 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 ..
-l use a long listing format
-h, --human-readable with -l, print sizes like 1K 234M 2G
...
The output is not standardized across commands. Some commands have a --help flag that prints a summary and exits 0. Others print to standard error and exit 1. Some have no --help flag at all. The man page is always available; the --help flag is not.
A command that does not have a --help flag may have a -h flag that does something else. The -h for ls is human-readable, not help. Always check the man page for the command’s actual flags.
The info command displays the GNU documentation. It is a hypertext format with nodes and links.
$ info ls
The info interface uses keystrokes that are different from less. The n key goes to the next node, p to the previous, u to the parent, and q to quit. The info pages are often more detailed than the man pages for GNU tools.
The info pages are stored in /usr/share/info/. The man pages are stored in /usr/share/man/. The man pages are more widely available; the info pages exist for GNU tools but not for everything.
The man command falls back to info if the man page is not found and an info page exists. The info command is the primary documentation for GNU tools like coreutils, bash, and grep.
The pinfo command is an alternative info viewer with color and mouse support. It is not installed by default on all systems.
Complete Example Session
# ============================================
# PART 1: BASIC MAN
# ============================================
$ man ls
# ============================================
# PART 2: MAN SECTIONS
# ============================================
$ man 5 passwd
$ man 8 mount
# ============================================
# PART 3: WHATIS
# ============================================
$ whatis passwd
passwd (1) - change user password
passwd (5) - the password file
# ============================================
# PART 4: APROPOS
# ============================================
$ apropos "copy file"
$ man -k "copy file"
# ============================================
# PART 5: MAN -F
# ============================================
$ man -f ls
ls (1) - list directory contents
# ============================================
# PART 6: MAN -A
# ============================================
$ man -a passwd
# ============================================
# PART 7: --HELP
# ============================================
$ ls --help
$ grep --help
$ tar --help
# ============================================
# PART 8: INFO
# ============================================
$ info ls
$ info coreutils
# ============================================
# PART 9: MAN -W
# ============================================
$ man -w ls
/usr/share/man/man1/ls.1.gz
# ============================================
# PART 10: MAN -K
# ============================================
$ man -K "recursive copy"
The ten parts covered basic man, sections, whatis, apropos, man -f, man -a, --help, info, man -w, and man -K.
Quick Reference
man Options
| Option | Effect |
|---|---|
man command | Show the page |
man N command | Show the page in section N |
man -k keyword | Search descriptions |
man -f command | Short description |
man -a command | All matching pages |
man -w command | Path to the page |
man -K string | Search all pages |
Manual Sections
| Section | Content |
|---|---|
| 1 | User commands |
| 2 | System calls |
| 3 | Library functions |
| 4 | Special files |
| 5 | File formats |
| 6 | Games |
| 7 | Miscellaneous |
| 8 | System administration |
| 9 | Kernel routines |
Search Commands
| Command | Purpose |
|---|---|
apropos keyword | Search descriptions |
whatis command | Short description and section |
man -k keyword | Same as apropos |
man -f command | Same as whatis |
Other Help
| Command | Purpose |
|---|---|
command --help | Short usage summary |
info command | GNU hypertext documentation |
pinfo command | Alternative info viewer |
man Navigation
| Key | Action |
|---|---|
| Space | Next page |
b | Previous page |
/pattern | Search forward |
n | Next match |
q | Quit |
Best Practices
โ Do This:
# Use man for the full documentation
man ls # โ
# Use the section when there are multiple pages
man 5 passwd # โ
# Use whatis to find the section
whatis passwd # โ
# Use apropos when the command name is unknown
apropos "copy file" # โ
# Use --help for a quick summary
ls --help # โ
# Use man -k for keyword search
man -k "recursive copy" # โ
# Search within a man page
/pattern # โ
โ Don’t Do This:
# Don't assume -h means help
ls -h # human-readable, not help # โ ๏ธ
# Don't assume --help exists for every command
somecommand --help # may fail # โ ๏ธ
# Don't forget the section for file formats
man passwd # shows the command, not the file format # โ ๏ธ
# Don't memorize when you can look up
# The exam allows man pages # โ
# Don't use online docs for the installed version
# The local man page is authoritative # โ ๏ธ
# Don't skip the SEE ALSO section
# It lists related commands # โ
# Don't ignore the EXAMPLES section
# It shows the common usage # โ
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Wrong page shown | Multiple sections | Use man N command |
| Command not found in man | Not in the database | Use --help or search online |
apropos returns nothing | Database not built | Run sudo mandb |
--help fails | Command does not support it | Use man |
-h is not help | Command-specific flag | Check the man page |
| Page too long to scan | No search | Use /pattern to find options |
| Section unknown | Not documented | Use whatis |
Real-World Examples
1. Basic man
man ls
2. File Format Page
man 5 fstab
3. System Admin Command
man 8 mount
4. Find a Command
apropos "disk usage"
5. Short Description
whatis tar
6. Search the Page
man tar
# then type: /--exclude
7. Quick Help
tar --help
8. Info Page
info coreutils
9. Path to Page
man -w grep
10. Search All Pages
man -K "recursive"
Visual
Manual Page Structure
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LS(1) User Commands LS(1)โ
โ โ
โ NAME โ
โ ls - list directory contents โ
โ โ
โ SYNOPSIS โ
โ ls [OPTION]... [FILE]... โ
โ โ
โ DESCRIPTION โ
โ List information about the FILEs (the current โ
โ directory by default). โ
โ โ
โ OPTIONS โ
โ -a, --all โ
โ do not ignore entries starting with . โ
โ -l use a long listing format โ
โ -h, --human-readable โ
โ with -l, print sizes like 1K 234M 2G โ
โ โ
โ SEE ALSO โ
โ Full documentation <https://www.gnu.org/...> โ
โ or available locally via: info '(coreutils) ls...' โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Manual Sections
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SECTION 1: User Commands โ
โ ls, cp, mv, grep, find, tar โ
โ โ
โ SECTION 5: File Formats โ
โ passwd, fstab, hosts, crontab โ
โ โ
โ SECTION 8: System Administration โ
โ mount, useradd, systemctl, iptables โ
โ โ
โ A command can have pages in multiple sections. โ
โ man passwd โ section 1 (the command) โ
โ man 5 passwd โ section 5 (the file format) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Finding the Right Page
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Command name unknown? โ
โ โโโ apropos "keyword" โ
โ โ
โ Command name known, section unknown? โ
โ โโโ whatis command โ
โ โ
โ Section known? โ
โ โโโ man N command โ
โ โ
โ Quick summary? โ
โ โโโ command --help โ
โ โ
โ Full GNU documentation? โ
โ โโโ info command โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
man Navigation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ man ls โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Space โ next page โ โ
โ โ b โ previous page โ โ
โ โ /pattern โ search forward โ โ
โ โ ?pattern โ search backward โ โ
โ โ n โ next search match โ โ
โ โ N โ previous search match โ โ
โ โ g โ go to beginning โ โ
โ โ G โ go to end โ โ
โ โ q โ quit โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ The pager is less. The keys are less keys. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Command | Purpose |
|---|---|
man command | Show the manual page |
man N command | Show section N |
man -k keyword | Search descriptions |
man -f command | Short description |
man -a command | All matching pages |
man -w command | Path to the page |
apropos keyword | Search descriptions |
whatis command | Short description and section |
command --help | Quick usage summary |
info command | GNU hypertext documentation |
Key takeaways:
manis the primary documentation interface. It displays the manual page in a pager. The page has a consistent structure: NAME, SYNOPSIS, DESCRIPTION, OPTIONS, FILES, SEE ALSO. The SYNOPSIS uses conventions for optional and repeatable arguments.- The manual is divided into sections. Section 1 is user commands, section 5 is file formats, section 8 is system administration. A command can have pages in multiple sections. Use
man N commandto specify the section. whatisshows the section. The output lists the command, the section in parentheses, and the description. Use it to determine which section to read.apropossearches the descriptions. It is the tool to use when the command name is unknown.man -kis equivalent. The database is built bymandb.--helpis a quick summary, not a substitute forman. It is faster but not standardized. Some commands do not support it. Themanpage is always available.infois the GNU hypertext documentation. It is more detailed than themanpage for GNU tools. The navigation keys are different fromless.- The local documentation is authoritative. The
manpage on the system reflects the installed version. Online documentation may be for a different version.
Remember: The LFCS allows documentation. The man pages are installed on the exam system. The skill the exam rewards is not memorization but the ability to find the answer. Use man for the full documentation. Use the section when there are multiple pages. Use whatis to find the section. Use apropos when the command name is unknown. Use --help for a quick summary. Use info for GNU tools. And use /pattern to search within a page. The commands are the answers, and the documentation is how you find them.
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!