On Unix-like operating systems, the whereis command locates the binary, source, and manual page files for a command.

This page covers the Linux version of whereis.

Description

whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form “.ext”, for example, “.c”. Prefixes of “s.” resulting from use of source code control are also handled. whereis then attempts to locate the desired program in a list of standard Linux places.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

Syntax

whereis [-bmsu] [-BMS directory… -f] file name…

Options

Examples

whereis perl

List the directories where the perl source files, documentation, and binaries are stored.

whereis -u -M /usr/man/man1 -S /usr/src -f *

Find all files in the current directory that are not documented in /usr/man/man1, whose source resides in /usr/src.

find — Find files within a directory hierarchy.which — Locate the binary executable of a command.