Using man, info, and --help - How to Read Official Documentation

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

Lina: Every time I forget a command's options, I end up searching the web... Is there a better way?
Linny-senpai: Linux has built-in documentation tools! Learn --help, man, and info and you can look up almost anything right in the terminalAn interactive program that reads the commands you type and runs them..

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

  1. Quick option check → command --help
  2. Full reference → man command
  3. Can't remember the command name → man -k keyword

1. --help: The Quickest Way

Conclusion: command --help works on almost any command and shows options instantly.

Lina: What should I try first?
Linny-senpai: Start with --help. Almost every command supports it and the output appears 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 command shows the full manual, navigated like less with / search.

Lina: What if I need more detail than --help gives me?
Linny-senpai: That's when you use man — short for manual. It's the complete official documentation for each command.

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
Lina: I always see [OPTION]... and [FILE]... in SYNOPSIS but I'm not sure what the symbols mean.
Linny-senpai: Square brackets [] mean the argument is optional, and ... means you can specify multiple values. So ls [OPTION]... [FILE]... means you can pass zero or more options and zero or more files.

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 as apropos) finds commands by what they do.

Lina: What if I can't remember the command name at all?
Linny-senpai: Use man -k with a keyword related to what you want to do. It searches all man page descriptions and shows matching commands.
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 command gives detailed GNU docs, often deeper than man pages.

Lina: If man pages cover everything, when would I need info?
Linny-senpai: GNU tools like grep, awk, and find often have more complete documentation in info than in man. Think of man as a quick reference and info as a full textbook.

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)

Lina: I opened 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)
Lina: It shows (END) at the bottom, but nothing happens no matter what I press...
Linny-senpai: Take a breath. man uses the same key controls as less to quit. Instead of Ctrl+C, try pressing q.
Lina: Oh, q got me out! So man opens its own screen, and regular Ctrl+C doesn't work there.
Linny-senpai: Exactly. 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 /octal in man chmod, and man -k owner to make the habit stick.

Lina: I want to try what I learned!
Linny-senpai: Let's work through a few exercises. Each one has 3 hints — open them one at a time if you get stuck.

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
  1. Open the manual with man chmod
  2. Type /octal and press Enter
  3. This jumps to the section explaining numeric (octal) permissions
  4. Press q to 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

Lina: So when exactly should I use each one?
Linny-senpai: Here's a simple decision table.
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 -lals --help
  • Look up how chmod numbers work → man chmod
  • Find a compression command → man -k compress
  • Learn advanced awk usage → info awk
Lina: I used to be intimidated by man pages since they're in English. But now that I know I can search with /, they feel much more approachable!
Linny-senpai: Exactly. Start by scanning SYNOPSIS and EXAMPLES — just those two sections will answer most questions. The rest of the page becomes useful as you gain more experience.

3-Line Summary

  1. For a quick check, use command --help
  2. For a full read, use man command (press q to quit)
  3. When you can't recall the command name, use man -k keyword to find it

Next Reading

Share this article

Next steps