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:
- whereis -b : Searches for executable files. It looks in paths like "/usr/bin", "/usr/sbin", "/usr/lib[64]", "/etc"," /usr/etc", "/usr/local", "/usr/include"," /usr/libexec", and "/usr/share".
- whereis -m : Searches for man pages (documentation). It looks in paths like "/usr/share/man".
- whereis -s : Searches for source code files. It looks in paths like /usr/src.
- whereis -l : (lowercase "L") Lists the paths being searched.
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.