[Linux] find-which, whereis, locate, find

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.