Linux whereis command Find the file location of executables, source code, and man pages.

  

whereis is used to find the location of executables, source code, and man pages. The whereis command can only be used for program name searches, and only searches for binary files (parameter -b), man documentation (parameter -m), and source code files (parameter -s). If the parameter is omitted, all information is returned.


Syntax format
whereis [parameters][file...]whereis [-bfmsu][-B <directory>...][-M <Table of Contents >...][-S <Directory>...][File...]


Parameters
-b: Find only binary files-B<Directory> : Find the binary file only in the set directory -f: Do not display the path name before the file name -m: Find only the description file -M<Directory>: Find the description file only in the set directory -s: Find only the original code File-S<Directory> Find the original code file only in the set directory -u: Find files that do not contain the specified type


Example

Use the "whereis" command to find The git related files, commands and results are as follows:
# whereis gitgit: /usr/bin/git /usr/share/man/man1/git.1.gz

Use the "whereis" command to find git binary The file location, command, and result are as follows:
# whereis -b gitgit: /usr/bin/git

Copyright © Windows knowledge All Rights Reserved