You will never remember every option of every Linux command, and that is normal. The real skill of a system administrator is not to know everything by heart, but to find the information in seconds without leaving the terminal. This guide shows the tools built into every Linux system for exactly that.
What you will learn
- Display the quick help of a command with
--help - Read the full documentation with
man - Navigate a man page (search, move forward, quit)
- Find a command by keyword with
aproposandwhatis - Choose the right help tool for the situation
Installing the help tools
On a minimal installation, do not assume what is there. The picture varies
from one distribution to another, and not always the way you would expect: on a
minimal AlmaLinux 10, man, apropos and whatis are present, with 3,100
manual pages, but info is missing and the man-pages package is not
installed. On a "minimized" Ubuntu, it is the other way round:
/usr/bin/man is only a 320-byte script inviting you to run unminimize.
The reflex that settles it, before installing anything:
command -v man apropos whatis infoThe missing tools come with the packages below.
sudo apt install man-db manpages manpages-dev info pipxpipx install tldrsudo mandbtldr --updatesudo dnf install man-db man-pages infosudo mandbpipx is not in the base repositories of Rocky and RHEL 9: you first have
to enable the EPEL community repository (Extra Packages for Enterprise
Linux). On Fedora, EPEL is unnecessary, pipx is already available.
sudo dnf install epel-releasesudo dnf install pipxpipx install tldrtldr --updateThe packages in detail. The man-db row is the one that matters: without
it, no man page can be read at all, and apropos has nothing to search.
| Package | Provides | Why it is needed |
|---|---|---|
man-db | man, apropos, whatis | The documentation engine: without it, no man page can be read |
manpages / man-pages | The generic pages (system calls, C functions, conventions) | Without it, sections 2, 3 and 7 are empty; the pages shipped by each package stay |
info | info | Extended GNU documentation (optional) |
pipx | pipx | Install Python tools in isolation |
tldr (via pipx) | tldr | Community cheat sheets of practical examples (optional) |
The sudo mandb command builds the index used by apropos and whatis.
Without that step, those commands always return nothing appropriate.
Quick help: --help
It is the simplest reflex. Almost every Linux command accepts the --help
option, which prints a summary of the syntax and of the main options:
ls --helpYou get a summary of the syntax, of the main options and sometimes examples. The output usually fits on one screen.
cp --helpmkdir --helpThe right moment for --help is when you already know the command and only
look for the name of an option: the answer fits on one screen, where the
full man page asks you to navigate.
Some commands use -h instead of --help (or as well). If --help does not
work, try -h.
Full documentation: man
man (manual) is the documentation system built into Linux. Every command,
configuration file and system function has a man page.
man lsYou enter an interactive pager (less). Here are the essential keys:
| Key | Action |
|---|---|
| Space | Move forward one page |
| b | Move back one page |
| / then a word | Search the page |
| n | Next search result |
| N | Previous result |
| q | Quit |
Structure of a man page
Man pages follow a standard layout. Knowing its sections lets you find the information without reading everything: jump to SYNOPSIS for the syntax, to OPTIONS for a switch, to EXAMPLES for something to copy.
| Section | Content | What you look for there |
|---|---|---|
| NAME | Name and short description | Check that it is the right command |
| SYNOPSIS | Usage syntax | See the expected options and arguments |
| DESCRIPTION | Detailed explanation | Understand what the command does |
| OPTIONS | Full list of options | Find the option you need |
| EXAMPLES | Usage examples | Copy an example and adapt it |
| FILES | Related configuration files | Find where to change the behaviour |
| SEE ALSO | Related commands and pages | Discover complementary commands |
| EXIT STATUS | Exit codes | Understand errors in a script |
When you are in a hurry, the pager search is the shortcut: type
/EXAMPLES in the man page then Enter, and you jump straight to the
examples, without reading the previous sections.
The manual sections
The manual is organised in numbered sections. Some names exist in several
sections at once, such as passwd, which is both a command and a
configuration file:
| Section | Content |
|---|---|
| 1 | User commands |
| 5 | File formats and conventions |
| 8 | System administration commands |
To read a specific section:
man 5 passwd # the format of the /etc/passwd fileman 1 passwd # the passwd commandWithout a number, man shows the first section it finds.
Finding a command: apropos and whatis
These two commands query an index of the manual pages, not the pages
themselves. On a fresh installation that index may be missing: sudo mandb
builds it.
apropos: "I do not know the command"
You know what you want to do, but not which command does it. apropos
searches the short descriptions of every installed man page for the words
you type:
apropos "copy files"apropos partitionapropos "network interface"cp (1) - copy files and directoriesscp (1) - OpenSSH secure file copyrsync (1) - a fast, versatile, remote (and local) file-copying toolwhatis: "I know the command, what is it in one line?"
whatis prints the short description of a command, the one from the
NAME section of its man page:
whatis ls cp mkdir rmls (1) - list directory contentscp (1) - copy files and directoriesmkdir (1) - make directoriesrm (1) - remove files or directoriesinfo: extended documentation (GNU)
Some GNU tools (coreutils, grep, sed, awk) offer info pages that are
more detailed than their man pages, with extra examples:
info coreutilsinfo grepNavigation is different: Enter follows a link, u goes up, q quits. In practice, man pages are enough 95% of the time.
tldr: concrete examples, right away
Man pages are complete but sometimes intimidating for a beginner. tldr
(Too Long; Didn't Read) offers community cheat sheets of practical examples,
right in the terminal:
tldr tar tar
Archiving utility. Often combined with a compression method, such as gzip or bzip2.
- Create an archive from files: tar cf target.tar file1 file2 file3
- Extract an archive in the current directory: tar xf source.tar
- Create a gzipped archive: tar czf target.tar.gz file1 file2 file3
- Extract a gzipped archive in the current directory: tar xzf source.tar.gzEach sheet shows the 5 to 8 most frequent use cases with commands ready to copy.
Offline documentation: /usr/share/doc
Installed packages sometimes drop documentation into /usr/share/doc/:
README files, changelogs and configuration examples.
ls /usr/share/doc/openssh-server/You will find README files, a CHANGELOG, configuration examples. It helps
when the man page does not cover a specific case.
Which tool should you use?
The right reflex depends on what you already know. Read the Situation column
first: if you know the name of the command, --help then man are enough; if
you do not, apropos searches the descriptions of every installed page. The
difference matters, because looking up an unknown command with man never
returns anything.
| Situation | Tool | Example |
|---|---|---|
| I know the command, I look for an option | --help | tar --help |
| I need the full reference of a known command | man | man tar |
| I do not know which command does the job | apropos | apropos archive |
| I want concrete examples quickly | tldr | tldr tar |
| I look for detailed examples (GNU) | info | info tar |
| I look for a configuration file | man 5 | man 5 fstab |
Practical exercise
-
Show the quick help of
ls:Terminal window ls --helpSpot the option that shows sizes in a readable format (KB, MB).
-
Open the man page of
cp:Terminal window man cpSearch
/recursiveto find the option that copies directories. Quit with q. -
Look for a command that shows disk space:
Terminal window apropos "space usage"You find
dfanddu:df (1) - report file system space usagedu (1) - estimate file space usage -
Check with
whatis:Terminal window whatis df du
Why "space usage" and not "disk usage"
The phrase that comes naturally to mind, apropos "disk usage", returns
neither df nor du. It is not a bug: apropos looks for the words you type
in the actual descriptions of the pages, and the coreutils ones say
report file system space usage and estimate file space usage. The word
"disk" appears nowhere.
Depending on what is installed on the machine, you get either
disk usage: nothing appropriate. (exit code 16), or, more puzzling still,
other unrelated pages that do contain the phrase:
podman-system-df (1) - Show podman disk usagequota (1) - display disk usage and limitsThe lesson holds for every use of apropos: search with the vocabulary of the
page, not your own. If an attempt returns nothing, rephrase with a synonym
closer to the jargon, or search several words at once with
apropos -a file space usage.
Troubleshooting
Almost all of these symptoms share one cause: the manual pages or their
index are not on the machine. It is common on container images and
minimal installations, where documentation is removed to save space. Before
concluding that a command does not exist, check that its page exists, with
man -w.
| Symptom | Cause | Fix |
|---|---|---|
No manual entry for xxx | Man page not installed | Install the man-db package and the command's package |
whatis: command not found or apropos: command not found | man-db not installed | sudo apt install man-db manpages (Debian) or sudo dnf install man-db man-pages (RHEL) |
apropos returns nothing appropriate | Man pages missing, index not built, or keyword absent from the descriptions | sudo mandb; then rephrase with the pages' vocabulary (space usage, not disk usage) |
apropos answers, but not with the expected command | The keyword exists in other pages | whatis <command> to read its actual description, then search with those words |
apropos silent although the index is up to date | The page was removed from disk | man -w <command> tells whether the page still exists |
tldr: command not found | Package not installed | Install it with pipx install tldr |
tldr returns nothing | Local database missing | Run tldr --update to download the sheets |
tldr --update fails with Did not find end of central directory signature | Buggy Haskell client (the tldr package from Debian/RHEL repositories) | Remove the system package (sudo apt remove tldr), then install the Python client: pipx install tldr |
--help prints too much text | Long output | Use ls --help | less to page through it |
Put it into practice
Finding things fast takes practice on real questions. This lab drops you into a
disposable shell with puzzles to solve using man, --help and
apropos: find the right option, the right section, the right command, and
the output you produce is compared with the expected result.
Key points
--helpgives a quick reminder of a command's options.tldrshows practical examples ready to copy, ideal for commands you rarely use.manis the reference documentation. Type/to search, q to quit.aproposfinds a command by keyword when you do not know its name.whatisgives the one-line description of a known command.- A minimal installation may lack some of these tools: check with
command -v man apropos whatis infobefore installing anything. - The real skill is not to remember everything, it is knowing how to search fast.
Knowledge check
Make sure the essentials of this guide are yours. The questions only cover what was explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Install a Linux server
A new full quiz with random questions
Work again only on the questions you missed