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

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

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 terminal.

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

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

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 permission 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

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

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.

5. 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.

Next Reading