Skip to main content

whereis

Explanation

The whereis command locates the binary, source, and manual page files for a command. It is more specialized than locate or find as it specifically searches in standard Linux directories for these three types of files associated with a given program name.

Basic Syntax

whereis [options] [-BMS directory... -f] name...

Common Flags and Options

FlagDescription
-bSearch for binaries only.
-mSearch for manuals only.
-sSearch for sources only.

Real-world Examples

  1. Find the binary, source, and man pages for bash:

    whereis bash

    (Output might look like: bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz)

  2. Find only the binary for python:

    whereis -b python
  3. Find only the manual page for ls:

    whereis -m ls