Linux whereis Command
The Linux whereis command is used to locate files.
This command searches for files that meet the criteria in 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 manual pages. For locating general files, you need to use the locate command.
Syntax
whereis [-bfmsu][-B <目录>...][-M <目录>...][-S <目录>...][文件...]
Parameters:
Examples
Use the "whereis" command to check 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 above from left to right is the queried program name, bash path, and bash's man manual page path.
If the user needs to query binary files or help files separately, the following commands can be used:
$ whereis -b bash $ whereis -m bash
The output information is as follows:
$ whereis -b bash #显示bash 命令的二进制程序 bash: /bin/bash /etc/bash.bashrc /usr/share/bash # bash命令的二进制程序的地址 $ whereis -m bash #显示bash 命令的帮助文件 bash: /usr/share/man/man1/bash.1.gz #bash命令的帮助文件地址Other Extensions
Linux Command Reference