"Linux Learning note four" file Search command

Source: Internet
Author: User

A file Search locate

Search faster by file name in background database locate file name//locate command searches the background database/var/lib/mlocate//updates the database updatedb

  

  

Two command search commands Whereis and which

Search for the path to the command and where the help document is located Whereis lswhereis-b only see the feasibility file Whereis-m find help files only


which

  

Three-File search find

Find [Search Range] [search criteria]find/-name Install.log//linux wildcard characters * matches any content? Match any one of the characters [] match any one of the characters in brackets//case insensitive Find/root-iname install.log//search Find/root-user root//by owner to find files without owners Find/root- nouser//Find Files Modified 10 days ago find/var/log/-mtime +10-10 10 within 10 10 days +10 10 days ago Atime file access time CTime change file properties mtime Modify file Contents// Find file size is 25kb file for find. -size 25k-25k less than 25kb file 25k equals 25kb file +25k greater than 25kb file//Find I node 262422 file find. -inum 262422

  

Find files larger than 20kb and less than 50kb in the/etc/directory find/etc-size +20k-a-size-50k-a and logic with two conditions are satisfied with the-O or logic or two conditions satisfy one can//find/etc/directory greater than 20kb less than 50KB, and show details find/etc-size +20k-a-size-50k-exec ls-lh{}\;-exec/-ok command {}\; Perform actions on search results

  

Search for eligible string grep in four files

You can use regular expressions to match

Match a qualifying string in a file grep [options] string file name option-I ignore case-V exclude specified string

  

"Linux Learning note four" 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.