Linux Comm Whereis
# Linux whereis Command
[ Linux Command Manual](#)
The Linux whereis command is used to find files.
This command searches for files that match specified criteria within specific directories. These files should be source code, binary files, or help files.
This command can only be used to find binary files, source code files, and man pages. To locate general files, you should use the locate command.
### Syntax
whereis [-B ...][-M ...][-S ...][file...]
**Parameters**:
* -b Search only for binaries.
* -B Search only for binaries in the specified directories.
* -f Do not display the path prefix before the filename.
* -m Search only for manuals.
* -M Search only for manuals in the specified directories.
* -s Search only for source code.
* -S Search only for source code in the specified directories.
* -u Search for files that do not contain any of the specified types.
### Examples
Use the "whereis" command to find the location of the "bash" command, enter the following command:
$ whereis bash
After executing the above command, the output information is as follows:
bash:/bin/bash/etc/bash.bashrc/usr/share/man/man1/bash.1.gz
Note: The output information from left to right is the program name, the bash path, and the bash man page path.
If you need to search for binary files or help files separately, you can use the following commands:
$ whereis -b bash $ whereis -m bash
The output information is as follows:
$ whereis -b bash # Display the binary program for the bash command bash: /bin/bash /etc/bash.bashrc /usr/share/bash # The address of the binary program for the bash command $ whereis -m bash # Display the help file for the bash command bash: /usr/share/man/man1/bash.1.gz # The address of the help file for the bash command
[ Linux Command Manual](#)
YouTip