What Is the Whatis Linux Command?

What Is the Whatis Linux Command?

Finding the right documentation starts with knowing what a command name refers to. The whatis command searches manual page names and prints their short descriptions.

You’ll see how to look up names with exact matches or wildcards, and how to check an empty result.

TL;DR: whatis in one command

The whatis command looks up a manual page name and prints its short description.

whatis ls
ls (1)               - list directory contents
  • Use the form shown here for one or more manual page names:
  • The wildcard flag searches page names by shell-style wildcard. A separate regular-expression flag handles expressions.
  • If there is no match, check the manual page and its index before assuming the command itself is missing.

What is the whatis command?

whatis finds manual pages by name and displays their one-line descriptions. The description comes from the page’s NAME section, while the lookup uses the man-db index database.

A manual page is a reference document for a command, library call or other topic. Its section number identifies the category. Section 1 covers user commands, section 2 system calls and section 8 administration commands.

A name can match multiple entries.

Use whatis to choose an entry, then open it with the man command for its full instructions. To search descriptions by topic, use apropos.

CommandWhat it answers
whatis lsWhat is the short description for the ls page?
man lsWhat are the page’s details and options?
apropos directoryWhich manual descriptions mention a topic?

How to use whatis step by step

Start with the exact page name, then widen the lookup only when you need to search for variants.

Step 1: Look up one command

Pass a command name as an argument. I ran whatis ls and got one description for the section 1 page.

whatis ls
Terminal showing the whatis ls manual description
The terminal result identifies the section 1 manual page and summarizes ls.

The section number in parentheses tells you which manual entry matched. Open it with man ls to read its full explanation.

Step 2: Look up several names

Place multiple names after the command to request a description for each one. Different sections may produce several rows for one name.

whatis ls pwd cat

This is useful for comparing command names, but it does not search for a phrase inside manual descriptions.

Step 3: Match names with a wildcard

Add the -w option when the page name is only partly known. Quote the wildcard so the shell passes it to whatis rather than expanding it against files in the current directory.

whatis -w 'cat*'

I compared that search with the exact name cat: the wildcard returned cat plus entries such as catan and catman. Use an exact lookup when you know the full name, since broader results can include unrelated pages.

Step 4: Use a regular expression when needed

The -r option treats the name as a regular expression. This expression matches page names ending in cat.

whatis -r 'cat$'

Quote expressions that contain characters the shell might interpret. Regular expressions can match more names than expected, so inspect each returned section before opening a page.

Common errors with whatis

A blank lookup means no indexed description matched. Check the page spelling and whether its manual page is installed, then check index freshness.

I asked for a made-up name and whatis printed “nonexistent-command-jd: nothing appropriate.” This identifies an empty manual lookup, so check the manual page and index separately.

SymptomCheckNext step
whatis command not foundCheck whether man-db utilities are installed.Install the distribution package that provides man-db.
nothing appropriateTry the spelling with man or check the manual-page location.Install the manual page package if absent.
A page was just installed but lookup misses itCheck whether the index has been refreshed.Run the documented index update when authorized.
Too many matchesReview wildcard or regex characters.Use the exact name or narrow by manual section.

On man-db systems, mandb creates or updates the index caches used by whatis. Updating system-wide caches may require administrator privileges, so follow the distribution’s instructions. Some systems refresh indexes on a schedule.

Linux distributions commonly provide whatis through man-db, though package names and defaults vary. Consult the distribution’s package documentation when the utility is unavailable. A command’s manual page may be packaged separately.

For manual-section filtering, man-db supports the -s option. Limiting a lookup to section 1 selects user-command entries. Available sections depend on installed pages.

Diagnose a missing result by checking the executable, its manual page, and the index in that order.

CaseWhat it tells youNext check
Nothing appropriateNo matching indexed manual description was found.Check spelling, installed manual pages, and index freshness.
Command not foundThe shell cannot locate an executable with that name.Check the command installation and shell search path.
Several rowsMore than one manual entry matches.Choose a section or inspect the corresponding page.

The shell’s “command not found” message and whatis’s “nothing appropriate” response refer to different checks. The first concerns executable lookup, while the second concerns indexed manual descriptions.

Use the distribution’s documented index-refresh procedure after adding manual pages. The man-db manual describes mandb as the utility for initializing or updating manual-page index caches.

Linux server work often starts with a small reference lookup before an administrator changes a service or investigates a fault. whatis helps identify a command page, but it does not run the command or report server health. Keep those tasks separate: use a manual description to choose the right reference, then check the command’s documented options before acting.

Use whatis while managing a Linux server

Server administration involves commands with similar names and different roles. A short manual description can help distinguish a service manager, a log viewer, a disk utility, or a network diagnostic before you open the full page.

For example, a reader who has heard of systemctl but has not used it can check its manual entry first. The description gives a starting point, while the full manual explains the subcommands and options. Check the local page rather than copying flags from a different distribution or release.

The same approach applies to commands such as journalctl, df, free, ss, and find. Their names may be familiar, but their pages cover distinct jobs. A quick lookup narrows the reference to open next.

Use this sequence when an unfamiliar server command appears in a runbook:

  1. Look up the exact command name with whatis.
  2. Read the matching manual section with man.
  3. Check the relevant option and its effect before running a state-changing operation.

A missing description does not prove that an executable is absent. It means the manual lookup found no indexed description, so check command availability and documentation separately.

Linux’s appeal for administrators often comes from being able to inspect and combine tools using a consistent shell, while choosing software and configuration suited to a particular server. These strengths do not make every distribution identical. Package names, defaults, and installed manual sections can differ, so the local documentation remains the authority for the system in front of you.

A concise manual description is useful at the start of that process because it helps map an unfamiliar name to its role. It cannot tell you whether a service is running, whether a disk is full, or whether a network socket is reachable. Select the command reference first, then use the appropriate diagnostic command for the question you need to answer.

That distinction matters on production machines. A command that reports status is different from one that changes configuration, and the manual may document both read-only and modifying options. Check the exact subcommand and flags before executing an operation that affects users or services.

For a repeatable server workflow, record the relevant manual page or section in the runbook rather than copying a short description as an instruction. The description helps locate the source, while the complete page gives context such as accepted arguments, environment assumptions, and exit behavior.

When comparing two commands, look at the complete descriptions and their manual sections. Similar names may refer to unrelated utilities, and the same name can have entries in multiple sections. Reading the section number before opening the page prevents a quick lookup from becoming a mistaken assumption.

These checks make whatis a useful first stop without asking it to answer questions it was not designed to answer. Use its one-line result to select documentation, and keep system diagnosis and administration in the relevant tools.

What Linux users value in the command line

Linux command-line tools make small tasks composable: one program can identify a reference, another can display it, and shell redirection can save output for later review. That flexibility also asks the operator to understand each command’s scope before joining tools together.

Documentation packages determine which manual pages a server has available. This local reference can help when network access is limited. A minimal setup may include fewer pages than a desktop system.

For a routine lookup, whatis is a narrow tool with a narrow answer. Use it to identify a page, then rely on the page itself for syntax, options, examples, and warnings that affect a server task.

Find the command files with whereis

whatis describes a manual entry. whereis reports known file locations for a named command, based on installed files and its search locations.

A whereis lookup can show whether an executable or manual page appears in its known locations. It reports paths, while whatis supplies a short description.

whereis checks known locations for executable and manual files. A locally built command can sit elsewhere. If the shell still runs it, inspect the shell command resolution.

Understand shell parameter expansion

Wildcard examples involve both the shell and whatis. Without quotes, the shell expands a star against current-directory filenames before starting the program.

Single quotes preserve the wildcard as one argument for whatis. Double quotes still allow some expansions, including variables, so single quotes suit a fixed manual-name search.

Quote regular expressions before passing them to whatis, since characters such as dollar signs can have meaning to the shell. whatis then applies its documented matching behavior.

Wildcard matching and regular expressions use different conventions. Choose the matching mode that fits the expression you need.

Choose the right manual section

When a lookup returns several entries, use the section number to choose the relevant reference. The numbers identify manual categories, not software versions.

The man-db whatis interface documents section filtering with its section option. A section filter narrows the candidates, but it cannot create a page that is not installed or repair a stale index. If the filtered lookup is empty, remove the filter once to see whether the page exists under another category.

Library functions can use a manual-entry name that differs from the executable name. For a broader topic search, apropos looks through manual names and descriptions.

Use whatis to check a candidate that apropos returns. Open its full entry with man when you need the details.

Conclusion

Use whatis for a concise manual description, then read the selected entry with man. Check spelling, page installation, and index freshness after an empty result.

Continue with the Linux man command guide for full documentation, or review the Linux commands reference when you need a wider list.

FAQ

These answers cover common whatis lookup and setup questions.

What does whatis do in Linux?

It searches manual page names and displays their one-line descriptions.

How do I install the whatis command?

Install the package that provides man-db using your distribution’s documented package manager. Package names and defaults vary.

Why does whatis say nothing appropriate?

No indexed manual page matched the name. Check the spelling, whether the page is installed, and whether the man-db index needs updating.