Command Query-whichwhich command is used to find the executable files (that is, the command) contained in the PATH which [-a] command-a: list all command files and directories to find-whereis, locate, find where whereis and locate are searched from the database, so the speed is higher than that of the command-the whichwhich command is used to find the executable files contained in the PATH (that is, the command)
Which [-a] command-a: list all commands
File and directory search-whereis, locate, find where whereis and locate are searched from the database, so the speed is fast, but the latest data cannot be found, because the database is updated every day by default (you can also execute the updatedb command to manually update the database ).
Whereis file/dirnamelocate [-I] keyword-I: case insensitive
The difference between whereis and locate is that whereis is a precise match, while locate is a keyword query. The find command is used to find data from a hard disk, which is slower, but more powerful.
find [PATH] [option] [action]
The find command contains three parts: [PATH] indicates the PATH to be searched, and [option] specifies the parameter, for example:
-Name: file name to be searched-atime-ctime-mtime file Time-type file type-size file size
Time-related parameters are commonly used, such:
-Mtime + n: list objects that have been changed before n days (excluding n)-mtime-n: list objects that have been changed within n days (including n) changed file-newer file: list new files than file
[Action] indicates the command to operate the searched file. The Command content ends with-exec boiling water and ends with \;, as shown below:
find /etc -name sysconfig -exec ls -l {} \;Among them, {} indicates all the content found by find. Therefore, the last command indicates searching for the sysconfig file and directory under/etc and listing its directory structure.