The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

whereis - Search for Files in Default Paths




The whereis command is used to search for executable files, man pages (documentation), and source code in default system paths.

The syntax of the whereis command is as follows
whereis [OPTIONS] COMMAND .

Here are some commonly used options with whereis:
Example:
$ whereis -b vi ←Search for the "vi" command in directories
vi: /usr/bin/vi
$ whereis -l | grep 'bin:' | head ←List directories where executable files are searched
bin: /usr/bin
bin: /usr/sbin
bin: /usr/lib
bin: /etc
...

The whereis command is useful for quickly finding the locations of executable files, man pages, and source code files on your system. It can help you identify where specific commands are located in your system's directory structure.

For more information and examples, you can refer to the provided link.