Linux File Search command

Source: Internet
Author: User

    • Locate file name
      • Search by file name in the background database, search faster
      • Background database location for search/var/lib/mlocate
      • The background database defaults to an update one day, you can force the update by using the command updatedb
    • The difference between which and Whereis commands
      • which + command (search for command path and alias)
      • Whereis + command (the path where the search command is located and the location of the help document)
      • Simply put, the Whereis command searches for more information than the which command.
    • $PATH system-defined environment variables
      • You can use the Echo $PATCH to view its value
    • Find [Search scope] [search criteria]
      • Use the Find command when the best range is accurate, otherwise it consumes too much system resources
      • The find command can use a wildcard character
      • * Match any Content
      • ? Match any one character
      • [] matches any one of the characters in brackets
      • Some of the specific options involved, you can check the Help document yourself
      • As an example,
        • sudo find/etc-size +20k-a-size-50k-mtime +10
        • Files that are larger than 20k and less than 50k and have been modified 10 days ago in the ETC directory
    • grep [Options] string file name
      • Note that the grep command can also use regular expression matches, while the locate command cannot

Linux File Search command

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.