Linux users: Find Files in linux

Source: Internet
Author: User

In linux, find, whereis, and locate files are mainly used.

Usually find is not very common. Hard drives are also very slow! Generally, we use whereis or locate to check whether it can be found. If it cannot be found, we use fin to search for it. Why? Because whereis does not use the database to search for data, it is quite fast, and there is no actual hard disk search, saving time!

The whereis command searches for qualified files in the specified directory. The attributes of the files should belong to the original code, binary files, or help files.


The locate command is used to find files that meet the conditions. It stores the files and directories in the database with the directory name and finds the files or directories that meet the conditions.

The use of locate is simpler. You can directly enter the "part name of the file" to obtain the result. (The locate command can quickly find the file when searching for the database. The database is updated by the updatedb program)


It is best to find.

Find is a very effective tool that can traverse the current directory or even the entire file system to Find some files or directories.

Find the file whose file name contains I

Find
-Name "I *. cpp"


Search for all files containing a word in Linux

Like grep hello/files-r-n, grep will output information similar to filenames: hello, not just knowing what the file name can know. -R is a subdirectory, and-n is a display file name. You can use grep -- help to see help. Many other parameters are available.





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.