The whereis
command is a Linux/Unix utility that is used to locate the binary, source code, and manual page files for a given command or program. The whereis
command searches the standard Linux/Unix paths for executables, libraries, and man pages, and it displays the location of the files it finds.
Here are some common examples of using the whereis
command:
- Locate the binary, source code, and manual page files for a command or program:
whereis <command_or_program>
For example, to locate the files for the ls
command, you would run:
whereis ls
The output would look something like this:
ls: /bin/ls /usr/share/man/man1/ls.1.gz
This indicates that the binary file for the ls
command is located at /bin/ls
and the manual page is located at /usr/share/man/man1/ls.1.gz
.
- Locate the binary file for a command or program:
whereis -b <command_or_program>
For example, to locate the binary file for the ls
command, you would run:
whereis -b ls
The output would look something like this:
ls: /bin/ls
- Locate the manual page files for a command or program:
whereis -m <command_or_program>
For example, to locate the manual page files for the ls
command, you would run:
whereis -m ls
The output would look something like this:
ls: /usr/share/man/man1/ls.1.gz
The whereis
command is a useful tool for quickly finding the location of important files related to a command or program, which can be useful when trying to troubleshoot issues or configure the program.