Linux Command - whereis

whereis - locate the binary, source, and manual page files for a command

Syntax

1
whereis [-bmsu] [-BMS directory... -f] filename...

Description

whereis locates source/binary and manuals sections for specified files.

Option Description
-b Search only for binaries.
-m Search only for manual sections.
-s Search only for sources.
-u Search for unusual entries.
-B set the path where whereis searches for binaries.
-M set the path where whereis searches for manual sections.
-S set the path where whereis searches for sources.

Example

search for source/binary/manual for command “java”

1
whereis java

output

1
java: /usr/bin/java

search for files for command “ls”

1
whereis ls

output

1
ls: /bin/ls /usr/share/man/man1/ls.1.gz

search for binary for command “ls”

1
whereis -b ls

output

1
ls: /bin/ls

search for manual for command “ls”

1
whereis -m ls

output

1
ls: /usr/share/man/man1/ls.1.gz

Reference