Manual Pages and Help in Linux: man, –help, info and Efficient Searching (Practical Examples)

One of the biggest differences between a beginner and a confident Linux administrator is
how fast they can find the right information. You don’t need to memorize every option
of every command. You just need to know where to look – and how to search efficiently.

In this guide we will walk through the three classic Unix/Linux help sources:
man, --help and info. You will learn how to:

  • Read and understand manual pages (man)
  • Search for commands when you only know “what you want”
  • Use --help quickly for everyday work
  • Navigate info pages when you need deep documentation
  • Combine searching with tools like grep for faster results

1. Understanding the Structure of man Pages

The man command is the traditional manual system on Unix-like systems. Almost every command, configuration file and system call has a manual page.

Basic usage:

man ls
man ssh
man fstab

Most man pages have a similar structure:

  • NAME – short description of the command
  • SYNOPSIS – basic usage and options syntax
  • DESCRIPTION – detailed explanation
  • OPTIONS – list of flags and their meaning
  • EXAMPLES (if available) – practical use cases
  • FILES, SEE ALSO, etc. – additional references

When you open a man page, you are usually inside the less pager. You can scroll with /, PageUp/PageDown, or Space. Press q to quit.

1.1 Manual Sections: What Does man 5 fstab Mean?

Manual pages are divided into numbered sections. The same name can exist in multiple sections – for example, a command and a configuration file.

  • 1 – User commands (executables)
  • 5 – File formats and configuration files
  • 8 – System administration commands

Examples:

man 1 passwd   # user-facing passwd command
man 5 passwd   # format of /etc/passwd file

man 5 fstab    # format of /etc/fstab
man 8 mount    # system-level mount command

As a sysadmin, sections 5 and 8 are especially important, because they describe config files and admin tools.

2. Searching Inside a man Page

Opening a man page is easy. The real power comes when you can quickly find what you need inside it.

Common search commands inside man/less:

  • /pattern – search forward for “pattern”
  • ?pattern – search backward for “pattern”
  • n – next match
  • N – previous match

Example: Searching for SSH key options in ssh man page:

man ssh
/IdentityFile
n
n

This will jump through all places where IdentityFile is mentioned. Very useful when the manual is long and complex.

3. When You Don’t Know the Command Name: man -k and apropos

Often you know what you want to do, but you don’t know which command to use. For this, Linux provides a keyword search in the manual database.

Two equivalent commands:

man -k keyword
apropos keyword

Example: You want to work with compressed archives, but you only remember “gzip”.

man -k gzip

Output might look like this:

gzip (1)             - compress or expand files
gzexe (1)            - compress executable files in place
zgrep (1)            - search possibly compressed files for a regular expression
zforce (1)           - force gzip files to have a .gz extension
...

Practical examples:

  • Find commands related to “firewall”:
    man -k firewall
    
  • Search for disk partitioning tools:
    man -k partition
    
  • Discover logs-related commands and files:
    man -k syslog
    

Once you see a promising command, open its page with man <name>. For example:

man zgrep

3.1 whatis: Quick One-Line Summaries

The whatis command shows a short description for one or more commands.

whatis ssh
whatis systemd
whatis crontab

This is useful when you just want to confirm what a command is, without reading the full manual.

4. Efficient Man Page Use in Daily Sysadmin Work

Here are some practical patterns you can use every day.

4.1 Find Options Related to a Specific Feature

Example: You want to know how to list hidden files with ls.

man ls
/hidden
n

You will quickly find the -a and -A options and see the explanation.

4.2 Find the Right Section for a Name

Example: You want documentation for systemd unit files.

man -k systemd | head

This will show you multiple man pages, like systemd.service(5),
systemd.timer(5), systemd.unit(5), etc. Now pick the one you
need:

man 5 systemd.service

4.3 Search All Man Pages for a String: man -K (Careful!)

Some systems support man -K, which searches the full text of all man pages for a given string. This can be slow, but sometimes it’s a life saver.

sudo man -K "MaxAuthTries"

Use this when you really have no idea where a directive is documented, but know its exact name.

5. --help: Fast Help for Everyday Use

While man is very complete, sometimes you just want a quick reminder of available options. Most modern commands support the --help flag.

ls --help
tar --help
systemctl --help
ssh --help

This usually prints a short usage summary and a list of options, then exits. It’s perfect when you already know the command but forgot the exact flag.

5.1 Combine --help with grep

For long help texts, you can filter the output with grep.

Example: Find options related to “recursive” in cp:

cp --help | grep -i recursive

Example: Find options related to “limit” in tar:

tar --help | grep -i limit

This is faster than opening the man page when you only need a specific keyword. It’s very handy during troubleshooting under time pressure.

5.2 Handling Commands That Print Help to stderr

Some commands print their help text to standard error (stderr) instead of standard output (stdout). In that case, piping directly to grep may not work as expected. Redirect stderr first:

mycommand --help 2>&1 | grep -i option

As a sysadmin, it’s good to remember this pattern, because many CLI tools behave this way.

6. info: When You Need Book-Style Documentation

The info system is another documentation format, often more detailed than man pages. Some GNU tools have very rich info pages.

Basic usage:

info coreutils
info ls
info bash

info pages are like hyperlinked documents. They are divided into nodes, and you can navigate between them.

Common keyboard shortcuts in info:

  • Space – next screen
  • b – previous screen
  • n – next node
  • p – previous node
  • u – go up one level
  • q – quit
  • s – search for a string across the document

Example: Searching inside info bash:

info bash
s history

This will find the section about shell history, where you can read in more detail than in a normal man page.

7. Practical Scenarios: Finding What You Need Fast

7.1 Scenario: You Want to Configure SSH Login Attempts Limit

Goal: Limit the number of failed login attempts via SSH.

  1. Search for a related option:
    man -k sshd | head
    
  2. Open the SSH daemon configuration manual:
    man 5 sshd_config
    
  3. Search inside the man page:
    /MaxAuthTries
    n
    
  4. Read the explanation and set the option in /etc/ssh/sshd_config.

7.2 Scenario: You Want to Understand a New Systemd Unit Type

Goal: Learn how systemd.timer works.

  1. Search for all systemd-related docs:
    man -k systemd | grep -i timer
    
  2. Open the relevant page:
    man 5 systemd.timer
    
  3. Search inside for “OnCalendar”:
    /OnCalendar
    n
    

In a few seconds you have the official documentation, syntax, and examples for timers.

7.3 Scenario: You Know the Command, but Forgot the Exact Option

Goal: Recursively copy a directory and preserve attributes with cp.

  1. Use --help for a quick reminder:
    cp --help | grep -i recursive
    
  2. Then check attributes:
    cp --help | grep -i preserve
    
  3. Construct the final command:
    cp -a /source/dir /destination/
    

No need to read the full man page when you only need one or two options you almost remember.

8. Tuning the Experience: Pagers and Environment Variables

By default, man uses the pager defined by the PAGER orMANPAGER environment variable (usually less).

To always enable smart search and status line with less, you can set:

export LESS="-iRM"
  • -i – case-insensitive search unless you use uppercase
  • -R – display raw control characters (colors)
  • -M – verbose prompt with position info

To change the pager for man only:

export MANPAGER="less -iRM"

Add these lines to your ~/.bashrc or ~/.zshrc to make them permanent.

9. Summary: Building the Habit of Using Documentation

Good sysadmins are not those who remember everything – they are the ones who are fast at finding the right information and understanding it. If you build a habit of using man, --help and info, you will:

  • Write correct commands more often on the first try
  • Understand configuration options instead of copying them blindly
  • Debug services faster using official documentation
  • Become more independent from random internet snippets

Key patterns to remember:

  • man <command> – full manual
  • man <section> <name> – config files and admin tools
  • man -k keyword / apropos keyword – search by topic
  • whatis <name> – one-line description
  • command --help – quick overview of options
  • command --help 2>&1 | grep -i keyword – filter help output
  • info <topic> – book-style documentation
  • Inside man/info: /pattern, n, N – fast search

The more you use these tools, the more natural they become – and the more powerful your Linux command line skills will be.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.