Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Getting help on Linux

By updated

Improve this page

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 you the help tools of Linux that make this possible: --help, man, apropos, whatis, info and tldr.

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 apropos and whatis
  • Choose the right help tool for the situation

Installing the help tools

On a minimal installation, do not assume what is there, because it varies from one distribution to another. On a minimal AlmaLinux 10, man, apropos and whatis are present, with their 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 small script inviting you to run unminimize.

The reflex that settles it, before installing anything:

Terminal window
command -v man apropos whatis info

For each name, command -v prints the path of the command if it exists, and prints nothing if it is missing. The tools that do not appear in the output are installed with the packages below.

Terminal window
sudo apt install man-db manpages manpages-dev info pipx
sudo mandb
pipx install tldr

pipx (in French) installs Python programs each in its own isolated environment and puts their launcher in ~/.local/bin, a folder that is not yet in the PATH (the list of folders where the shell looks for commands) on a fresh installation. After pipx install tldr, the tldr command therefore stays unfound until you have run pipx ensurepath, then opened a new session (or reloaded ~/.bashrc with source ~/.bashrc):

Terminal window
pipx ensurepath

In the new session, download the sheets, then check:

Terminal window
tldr --update
tldr --version

The packages in detail:

PackageProvidesWhy it is needed
man-dbman, apropos, whatisIt is the documentation engine: without it, no man page can be read
manpages / man-pagesThe generic pages (system calls, C functions, conventions)Without it, sections 2, 3 and 7 are empty; the pages shipped by each package stay
infoinfoExtended GNU documentation (optional)
pipxpipxInstall Python tools in isolation
tldr (via pipx)tldrCommunity 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:

Terminal window
ls --help

You get a summary of the syntax, of the main options and sometimes examples. The output usually fits on one screen.

Terminal window
cp --help
mkdir --help

The 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. Most commands, configuration files and system functions have a man page.

Terminal window
man ls

You enter an interactive viewer (the less pager). Here are the essential keys:

KeyAction
SpaceMove forward one page
bMove back one page
/ then a wordSearch the page
nNext search result
NPrevious result
qQuit

Structure of a man page

Man pages follow a standard layout. Knowing these sections lets you find the information without reading everything:

SectionContentWhat you look for there
NAMEName and short descriptionCheck that it is the right command
SYNOPSISUsage syntaxSee the expected options and arguments
DESCRIPTIONDetailed explanationUnderstand what the command does
OPTIONSFull list of optionsFind the option you need
EXAMPLESUsage examplesCopy an example and adapt it
FILESRelated configuration filesFind where to change the behavior
SEE ALSORelated commands and pagesDiscover complementary commands
EXIT STATUSExit codesUnderstand 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. Not every page has this section: those of ls and cp do not (GNU coreutils 9.7, tested on Debian 13), and the search then answers Pattern not found. In that case, tldr (further down) gives examples.

Shell builtins: help and type

Some commands are not programs but shell builtins. cd is one: man cd answers No manual entry for cd. Their help is read with help, and type tells you what kind of command you are dealing with:

Terminal window
type cd
help cd
Output on Debian 13 (Bash)
cd is a shell builtin
cd: cd [-L|[-P [-e]] [-@]] [dir]
Change the shell working directory.

The first line comes from type, the following ones from the start of help cd. If type answers cd is a shell builtin, look it up with help, not with man. The same reflex applies to echo, pwd or export.

The manual sections

The manual is organized in numbered sections. Some commands exist in several sections:

SectionContent
1User commands
2System calls (kernel functions)
3Library functions (C)
5File formats and conventions
7Conventions and miscellaneous topics
8System administration commands

To read a specific section:

Terminal window
man 5 passwd # the format of the /etc/passwd file
man 1 passwd # the passwd command

Without 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 descriptions of all man pages:

Terminal window
apropos "copy files"
apropos copy

apropos looks for the words you type in the descriptions, nothing more. On Debian 13, the phrase "copy files" returns only two commands:

apropos output for copy files, Debian 13
cp (1) - copy files and directories
install (1) - copy files and set attributes

With the single word copy, the list gets longer and also contains rsync and scp, whose descriptions do not contain the phrase "copy files":

apropos copy on Debian 13 (excerpt)
cp (1) - copy files and directories
rsync (1) - a fast, versatile, local/remote file-copying tool
scp (1) - OpenSSH secure file copy

A short word finds more pages than an exact phrase: start broad, then add words to narrow down. The section "Why space usage and not disk usage", further down, explains why.

whatis: "I know the command, what is it in one line?"

whatis prints the short description (NAME section) of a command:

Terminal window
whatis ls cp mkdir rm
Output
ls (1) - list directory contents
cp (1) - copy files and directories
mkdir (1) - make directories
rm (1) - remove files or directories

info: extended documentation (GNU)

Some GNU tools (coreutils, grep, sed, awk) offer info pages that are more detailed than their man pages, with extra examples:

Terminal window
info coreutils
info grep

Navigation is different: Enter follows a link, u goes up, q quits. In practice, man pages are enough for most questions.

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:

Terminal window
tldr tar
tldr tar (tldr 3.4.4, excerpt)
tar
Archiving utility. Often combined with a compression method, such as `gzip` or `bzip2`. More information: https://www.gnu.org/software/tar/manual/tar.html.
- [c]reate an archive and write it to a [f]ile: tar cf path/to/target.tar path/to/file1 path/to/file2 ...
- [c]reate a g[z]ipped archive and write it to a [f]ile: tar czf path/to/target.tar.gz path/to/file1 path/to/file2 ...
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: tar xvf path/to/source.tar.ext

In each example, the letters in square brackets recall the matching option ([c]reate for c, [f]ile for f), and path/to/... is replaced by your own paths.

Each sheet shows the most frequent use cases with commands ready to copy. The number of examples depends on the sheet published by the project, not on the client version: the excerpt above only shows the first ones.

Offline documentation: /usr/share/doc

Installed packages sometimes drop documentation into /usr/share/doc/:

Terminal window
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 man asks for the name of the command: it does not help you find it.

SituationToolExample
I know the command, I look for an option--helptar --help
I need the full reference of a known commandmanman tar
I do not know which command does the jobaproposapropos archive
I want concrete examples quicklytldrtldr tar
I look for detailed examples (GNU)infoinfo tar
I look for a configuration fileman 5man 5 fstab

Practical exercise

  1. Show the quick help of ls:

    Terminal window
    ls --help

    Spot the option that shows sizes in a readable format (KB, MB).

  2. Open the man page of cp:

    Terminal window
    man cp

    Search /recursive to find the option that copies directories. Quit with q.

  3. Look for a command that shows disk space:

    Terminal window
    apropos "space usage"

    On Debian 13, you find df and du:

    df (1) - report file system space usage
    du (1) - estimate file space usage
  4. 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 usage
quota (1) - display disk usage and limits

The 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

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

SymptomCauseFix
No manual entry for xxxMan page not installedInstall the man-db package and the command's package
whatis: command not found or apropos: command not foundman-db not installedsudo apt install man-db manpages (Debian) or sudo dnf install man-db man-pages (RHEL)
apropos returns nothing appropriateMan pages missing, index not built, or keyword absent from the descriptionssudo mandb; then rephrase with the pages' vocabulary (space usage, not disk usage)
apropos answers, but not with the expected commandThe keyword exists in other pageswhatis <command> to read its actual description, then search with those words
apropos silent although the index is up to dateThe page was removed from diskman -w <command> tells whether the page still exists
tldr: command not found right after pipx install tldr~/.local/bin is not yet in the PATH of the sessionpipx ensurepath, then open a new session (or source ~/.bashrc)
tldr: command not found, pipx never runClient not installedInstall it with pipx install tldr, then pipx ensurepath
man cd answers No manual entry for cdcd is a shell builtin, it has no man pagehelp cd, and type cd to confirm
dnf install epel-release answers No match for argumentOn RHEL 10, the package is not in the distribution repositoriesOfficial EPEL procedure for RHEL 10 (see above)
tldr returns nothingLocal database missingRun tldr --update to download the sheets
tldr --update fails with Did not find end of central directory signatureBuggy 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 textLong outputUse ls --help | less to page through it

Put it into practice

Finding things fast takes practice on real questions. The lab sets up a separate working folder on your workstation, with a donnees.txt file of five log lines. You extract three files from it: the last three lines, the number of lines, and only the lines that contain ERROR. For each one, you first look for the command with apropos, man or --help, then run it on your machine and write its output to the requested file. The check compares your files with the actual content of donnees.txt: naming the right command is not enough, you must produce the right result.

Writing to a file takes one more sign. A command normally prints its result on the screen. Add > file after the command and the result goes into that file instead of the terminal:

Terminal window
date > time.txt
cat time.txt

The first line prints nothing, because the date went into time.txt; cat then displays it. If time.txt already exists, > replaces its content without asking, so never aim it at a file you want to keep, donnees.txt included.

Key points

  • --help gives a quick reminder of a command's options.
  • tldr shows practical examples ready to copy, ideal for commands you rarely use.
  • man is the reference documentation. Type / to search, q to quit.
  • apropos finds a command by keyword when you do not know its name; a short word (copy) finds more pages than a phrase ("copy files").
  • A shell builtin such as cd has no man page: use help cd.
  • whatis gives the one-line description of a known command.
  • A minimal installation may lack some of these tools: check with command -v man apropos whatis info before 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

6 questions
6 min
70% to pass

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