Using man, info, and --help - How to Read Official Documentation
What you'll be able to do
- Choose between man, info, and --help depending on the situation
- Look up how to use an unfamiliar command on your own
Prerequisites (read these first)
What You'll Learn
By the end of this article, you'll be able to:
- Understand the difference between --help, man, and info and when to use each
- Navigate man pages with keyboard shortcuts and search
- Find commands by keyword when you can't remember the name
Quick summary
- Quick option check →
command --help - Full reference →
man command - Can't remember the command name →
man -k keyword
1. --help: The Quickest Way
Conclusion:
command --helpworks on almost any command and shows options instantly.
Usage
ls --help
Usage: ls [OPTION]... [FILE]... List information about the FILEs (the current directory by default). -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. -l use a long listing format ...(truncated)
If the output is too long to fit on screen, pipe it through less:
ls --help | less
Press q to exit.
Some commands also accept -h as a short form. Try curl -h as an example.
When to use --help
| Property | Details |
|---|---|
| Speed | Immediate |
| Amount | Concise (option list) |
| Coverage | Almost all commands |
| Best for | Checking option names and syntax |
2. man: Full Manual Pages
Conclusion:
man commandshows the full manual, navigated likelesswith/search.
Usage
man ls
You navigate man pages with the same keys as less.
Keyboard Shortcuts
| Key | Action |
|---|---|
Space / f |
Next page |
b |
Previous page |
q |
Quit |
/keyword |
Search forward (e.g. /recursive) |
n |
Next search result |
N |
Previous search result |
g |
Jump to top |
G |
Jump to bottom |
The / search shortcut is the most useful. Try man chmod, then type /octal to jump straight to the numeric permissionThe read / write / execute access rules set on a file or directory. section.
Structure of a man Page
Every man page follows the same section layout:
| Section | Contents |
|---|---|
| NAME | Command name and one-line description |
| SYNOPSIS | Usage syntax |
| DESCRIPTION | Detailed explanation |
| OPTIONS | All available options |
| EXAMPLES | Usage examples (when included) |
| SEE ALSO | Related commands |
Specifying Section Numbers
Some names have entries for both a command and a configuration file. Use a number to get the right one:
man 1 passwd # The passwd command man 5 passwd # The /etc/passwd file format
Common section numbers:
| Number | Contents |
|---|---|
| 1 | User commands (what you type in the shell) |
| 5 | File formats and configuration files |
| 8 | System administration commands |
3. man -k: Search by Keyword
Conclusion:
man -k keyword(same asapropos) finds commands by what they do.
man -k compress
bzip2 (1) - a block-sorting file compressor, v1.0.8 compress (1) - compress and expand data gzip (1) - compress or expand files xz (1) - Compress or decompress .xz and .lzma files zip (1) - package and compress (archive) files
man -k and apropos are the same command. Use whichever you find easier to remember.
If you get "nothing appropriate", run sudo mandb first to update the manual database.
4. info: Detailed GNU Documentation
Conclusion:
info commandgives detailed GNU docs, often deeper thanmanpages.
Usage
info grep
Keyboard Shortcuts
| Key | Action |
|---|---|
| Space / PageDown | Next page |
b / PageUp |
Previous page |
q |
Quit |
n |
Next node (section) |
p |
Previous node |
u |
Up to parent node (table of contents) |
| Enter | Follow a link |
If info is not installed, man will be shown instead. On Ubuntu, install it with sudo apt install info.
Lina Can't Escape man (Failure Example)
man chmod but I can't get back to the promptA symbol (like $ or #) shown when the shell is waiting for your input.... I kept mashing Ctrl+C!man chmod
CHMOD(1) User Commands CHMOD(1)
NAME
chmod - change file mode bits
...(truncated)
(END)
(END) at the bottom, but nothing happens no matter what I press...man uses the same key controls as less to quit. Instead of Ctrl+C, try pressing q.q got me out! So man opens its own screen, and regular Ctrl+C doesn't work there.man, info, and less all use the same "pager" — a tool that shows long text one screen at a time — and q is the shared way to quit any of them.5. Try It Yourself
Conclusion: Practice with
cp --help, searching/octalinman chmod, andman -k ownerto make the habit stick.
Exercise 1: Check cp's Options
Task: Display the option list for the cp command using the quickest method.
Show Hint 1 (Direction)
Recall the quickest way to check a command's options. It's just adding something after the command name.
Show Hint 2 (Command name)
Add --help after cp and run it.
Show Answer
cp --help
The option list appears, including -i (confirm before overwrite) and -r (copy directories recursively).
Exercise 2: Search octal in the chmod Manual
Task: Open the chmod manual and search for octal.
Show Hint 1 (Direction)
Recall the key you use to search for a specific word inside a manual page. It was in the man keyboard shortcuts table.
Show Hint 2 (Command name)
Open the manual with man chmod, then type /octal.
Show Answer
man chmod
- Open the manual with
man chmod - Type
/octaland press Enter - This jumps to the section explaining numeric (octal) permissions
- Press
qto quit
Exercise 3: Find the Command That Changes Ownership
Task: Use man -k to find the command that changes a file's owner.
Show Hint 1 (Direction)
Recall the way to look up a command when you don't remember its name. You can search by keyword.
Show Hint 2 (Command name)
Run man -k with a keyword like "owner" or "ownership".
Show Answer
man -k owner
This finds chown, among others.
6. Which Tool to Use
| Goal | Use |
|---|---|
| Check an option quickly | command --help |
| Read full command documentation | man command |
| Find a command by what it does | man -k keyword |
| Deep dive into GNU tools | info command |
Common scenarios
- Check options for
ls -la→ls --help - Look up how
chmodnumbers work →man chmod - Find a compression command →
man -k compress - Learn advanced
awkusage →info awk
3-Line Summary
- For a quick check, use
command --help - For a full read, use
man command(pressqto quit) - When you can't recall the command name, use
man -k keywordto find it