Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk2 min

What `which`, `whereis` and `whatis` Tell You in Linux

In Bash, `type -a` explains command resolution; `whereis` looks for associated files; and `whatis` returns short descriptions from local manual indexes.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use type -a name in Bash to see how the shell can resolve a command; use whereis name to look for related binary, source and manual files; and use whatis name for a brief description from local manual-page indexes. They answer different questions, so one is not a substitute for another.

Which command will Bash run?

When a name behaves unexpectedly, start with type -a name. Bash checks shell functions and builtins before searching PATH for an executable, and type -a can show multiple matches. This helps reveal whether a command name is being handled by a function or builtin instead of the executable you expected. See the Bash command lookup rules and the Bash manual entry for type.

As an Amazon Associate I earn from qualifying purchases.

To ask specifically for an executable path, use type -P name. The commonly used which name is aimed at executable lookup, but implementations vary; it is not a dependable way to explain every shell function, alias or builtin. The University of Vienna Bash workshop also frames command-finding tools around distinct questions, such as where a command is installed and what it does.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Where are the command’s related files?

whereis name looks for binary, source and manual files associated with a name. For example, whereis ls searches for related files, while whereis -b ls limits the search to binaries and whereis -m ls to manual pages. Use whereis -s name to look for source files.

Its search is based on standard locations and can use PATH and MANPATH; it does not guarantee that every installed copy will be found. The available locations vary by system and configuration. The util-linux whereis(1) manual documents further controls: -B, -M and -S constrain the binary, manual and source directories searched; -f separates those directory lists from the names to check; and -l lists effective lookup paths. Exact behavior and locations depend on the installed version and environment.

What does the name do?

whatis name searches manual-page names and returns short descriptions. For instance, whatis printf may show a shell-builtin entry and one or more manual entries, depending on which pages are installed and indexed on your system.

whatis reads local manual-page index data maintained by mandb; it does not search the internet or inspect program source. Missing entries or a stale index can make results incomplete. For wildcard matching, use whatis -w; for regular-expression matching, use whatis -r. Quote patterns when needed so your shell does not expand or interpret them before the command receives them. For fuller instructions than a one-line description, open the relevant page with man name. See the whatis(1) manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A practical sequence for an unfamiliar command

  1. Run type -a name in Bash to see the kinds of matches Bash can resolve.

  2. If you want only an executable path, run type -P name.

  3. Run whereis name to look for associated binary, source and manual files.

  4. Run whatis name for a brief manual-page description, then man name for fuller documentation.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check your own output: installed packages, distributions and configuration affect which files and manual entries are available. Bash-specific resolution details should not be assumed to describe every shell.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.