Command Lookup-which
The which command is used to find executable files contained in path (that is, commands)
which [-A] command
-A: List all commands
File and directory Lookup-Whereis, locate, find
Where Whereis and locate are found from the database, so they are faster, but unable to find the most recent data, because the database is updated daily by default (or you can perform a manual update of the UpdateDB command).
Whereis File/dirname
Locate [-i] keyword
-I: Ignore case
The difference between Whereis and locate is that Whereis is a precise match, and locate is the keyword lookup.
Find instructions are found from the hard disk, slower, but more powerful.
Find [PATH] [option] [action]
The find instruction contains three sections, [path] refers to the path to look for, and option specifies the parameters, such as:
-name the file name you want to find
-atime-ctime-mtime file time
-type file type
-size File Size
The parameters associated with time are more commonly used, such as:
-mtime +n: Lists files that have been changed before n days (excluding N)
-mtime-n: Lists files that have been changed within n days (including n)
-newer file: Lists files that are newer than
[Action] Indicates the instructions for the operation of the file after the lookup, and the instruction content is-exec with boiling water to the end, as follows:
Find/etc-name sysconfig-exec ls-l {} \;
where {} represents all the content found by find, the previous command represents looking for sysconfig files and directories under/ETC and lists their directory structure.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/