Skip to content
DevOps devops linux 5 min read

Getting Help (man & --help)

One of the biggest mindset shifts when learning Linux is realising that almost every answer you need is already on your machine. Instead of opening a browser and guessing, you can ask the command itself how it works. Linux ships built-in documentation for nearly every tool, and learning to read it makes you faster, more confident, and far less likely to run a command that does the wrong thing. This page covers the four ways to get help on the command line: the man pages, the --help flag, apropos for searching, and the friendlier modern tool tldr.

Why reading docs beats guessing

A command like rm (remove files) or dd (copy raw disk data) can destroy data in a second if you pass the wrong option. Guessing the flags is how people accidentally wipe a disk. The documentation tells you exactly what each option does before you press Enter. On a server you administer, this habit is not optional, it is the difference between a safe change and an outage.

Tip: Before running any command you found copy-pasted from the internet, read its --help or man page first. Understand every flag, especially anything with -r (recursive), -f (force), or --no-preserve-root.

Using man pages

man stands for “manual”. It opens the full reference manual for a command in a scrollable pager (a program that shows text one screen at a time). This is the most complete and authoritative source of help on a Linux system.

man ls

This opens the manual for ls (list directory contents). You will see sections like NAME, SYNOPSIS, DESCRIPTION, and OPTIONS.

The man page opens in a pager called less. You do not scroll with your mouse, you use the keyboard:

KeyWhat it does
Space or fPage down
bPage up
/ Line down / up
/wordSearch forward for “word”
nJump to next search match
NJump to previous match
gGo to the top
GGo to the bottom
qQuit and return to the shell

If you ever get “stuck” inside a man page and your prompt disappeared, just press q to quit.

Man page sections

The manual is split into numbered sections. The same name can exist in more than one section. For example, passwd is both a command (section 1) and a config file format (section 5).

SectionContents
1User commands (e.g. ls, cp)
5File formats and config files (e.g. /etc/passwd)
8System administration commands (e.g. systemctl, ufw)

To open a specific section, put the number first:

man 5 passwd

This shows the format of the /etc/passwd file, not the passwd command.

The —help flag

Most commands accept a --help flag (and often a short -h) that prints a quick summary of usage and options directly to your terminal. This is faster than man when you just need to remember one flag.

ls --help

Output:

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.

  -a, --all                  do not ignore entries starting with .
  -l                         use a long listing format
  -h, --human-readable       with -l and -s, print sizes like 1K 234M 2G etc.
      --help        display this help and exit
      --version     output version information and exit

The difference: man is the full reference, --help is the quick cheat sheet. Use --help for a fast reminder, man when you need the full story.

Gotcha: A few older commands print help when given a wrong flag instead of --help, and some use -h for something else entirely (in ls, -h means “human-readable sizes”, not help). When in doubt, try --help first.

Searching with apropos

What if you do not know the command name? apropos searches the short descriptions of every man page for a keyword. The name comes from “a propos” (French for “regarding”).

apropos "list directory"

Output:

dir (1)              - list directory contents
ls (1)               - list directory contents
vdir (1)             - list directory contents verbosely

Now you know ls is the command you wanted. On a fresh Ubuntu install you may need to build the search index once:

sudo mandb

A close relative is whatis, which gives a one-line description of a command you already know:

whatis systemctl

Output:

systemctl (1)        - Control the systemd system and service manager

The friendlier tldr tool

Man pages are thorough but can be overwhelming when you just want a practical example. tldr (“too long; didn’t read”) shows short, community-written pages full of real-world examples for the most common uses of a command.

Installing tldr on Ubuntu

On Ubuntu 22.04 and 24.04, install it with apt:

sudo apt update
sudo apt install -y tldr
tldr --update

The tldr --update step downloads the latest example pages. Now try it:

tldr tar

Output:

tar

Archiving utility.

- Create an archive from files:
    tar cf target.tar file1 file2 file3

- Create a gzipped archive:
    tar czf target.tar.gz file1 file2 file3

- Extract a (compressed) archive into the current directory:
    tar xf source.tar[.gz]

- List the contents of a tar file:
    tar tvf source.tar

That is far easier to absorb than the full man tar, which has dozens of options.

When to use which

ToolUse it when
manYou need the complete, authoritative reference and every option
--helpYou want a quick reminder of flags without leaving your prompt
aproposYou do not know the command name and want to search by topic
tldrYou want practical copy-paste examples for common tasks

Best Practices

  • Read the man or --help page of any destructive command (rm, dd, mkfs, chmod -R) before running it, especially on a server.
  • Use --help for a quick flag check and man when behaviour surprises you, the answer is almost always in the DESCRIPTION.
  • Install tldr on every server you manage so example-driven help is one command away.
  • Run sudo mandb once after install so apropos and whatis can search descriptions.
  • Remember q quits any man page or pager, you are never truly stuck.
  • Specify the section number (e.g. man 5 crontab) when a name exists as both a command and a config file.
Last updated June 15, 2026
Was this helpful?