recommended: More Linux file Lookup and comparison commands attention:Linux commands Daquan
The whereis command is used to locate the path of the instruction's binaries, source code files, and man manual pages, and other related files.
The Whereis command can only be used for program name searches, and only binary files (parameter-B), man description file (parameter-m), and source code file (parameter-s) are searched. If the argument is omitted, all information is returned.
The Whereis lookup is very fast compared to find, because the Linux system records all the files in the system in a database file, and when you use Whereis and the locate described below , the data is looked up from the database. Instead of looking through the hard drive like the Find command, the efficiency will naturally be high. However, the database file is not updated in real time and is updated once a week by default, so when we use Whereis and locate to find files, we sometimes find data that has been deleted, or just created the file, but cannot find it because the database file is not updated.
Whereis (option) (parameter)
-B: Find only binary files;-b< directory;: Find binaries only in the directory you set;-F: The path name before the file name is not displayed;-M: Only find the description file;-m< directory;: Find the description file only in the directory of the settings;-S: Find only the original code file ;-s< directory > Find the original code file only in the directory under Settings;-U: Finds files that do not contain the specified type.
Instruction name: The name of the instruction for the binaries, source files, and man manual pages to find.
Find all the relevant files
[[email protected] ~]# whereis tomcattomcat:[[email protected] ~]# whereis SVNSVN:/usr/bin/svn/usr/local/svn/usr/share /man/man1/svn.1.gz
Description: Tomcat is not installed, can not find out, SVN installation found a lot of related files
Only binary files are found
[Email protected] ~]# whereis-b SVNSVN:/usr/bin/svn/usr/local/svn[[email protected] ~]# whereis-m SVNSVN:/usr/share/ Man/man1/svn.1.gz[[email protected] ~]# whereis-s SVNSVN:
whereis -m svn the description document path and
whereis -s svn find source file.
Linux whereis-find binaries, code and other related file paths