The Find command for Linux

Source: Internet
Author: User

Search by file name
Find/etc-name Init
Find files with file name init in etc

Find/etc-name *init*
Find the file name in etc that contains init

Find/etc-name Init???
Find files with a file name beginning with Init and followed by three characters in etc

Find/etc-iname Init
Find files named init or init in etc (case-insensitive file name)

Search by File size
Find/-size +204800
Find files larger than 100M in the root directory

Find/-size-204800
Find files less than 100M in the root directory

Description
Files in 1.Linux are in the form of a database
2. A data block of 512 bytes, or 0.5K
3.100m=102400k=204800 a data block

Based on user query
Find/home-user Xiaol
Find files with owner Xiaol under the root directory

Find/home-group Xiaol
Locate the file that belongs to the group Xiaol under the root directory

Query by Time
Find/etc-cmin-5
Find files and directories with properties modified within 5 minutes under/etc
-amin Accessing Time Access
-cmin file attribute Change
-mmin File Contents Modify
-N Within minutes
+n N minutes ago

Query by Type
Find/etc-type F
Find all the files in/etc
F file
Catalog D
L Connection

Connection Query
Find/etc-size +163840-a-size-204800
Find files larger than 80M and less than 100M in/etc
-A and
-O or

Find based on I node
Find-inum 9176
Finding files with the I node 9176

Finding files and working with result sets
Find/etc-name init-exec ls-l {} \;
Find a file named init in etc and execute the ls-l command on the result

Find-inum 9716-exec rm-rf {} \;
Find the I node 9716 file and delete

The Find command for Linux

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.