Linux common commands (v)

Source: Internet
Author: User

File Search command: Find

Syntax: Find search scope match criteria

1. Find name by file name

For example: Find/etc-name init * matches all characters and? Match single character for flexible application

Find/etc-iname file names are case-insensitive when searching

2. Find size according to file size

For example: Find the directory to search for-size + file size (file size is represented by data block)

(In Linux, a data block is 512 bytes, 0.5K) 100mb=102400kb=204800 data block size

3. Search by file Owner

Example: Find/home-user Zhangsan

4. Search by file time attribute

For example: Find/etc-amin + 5 look for files or directories in the/etc directory that have been modified in 5 minutes

-cmin file properties are modified

-mmin file contents are modified

5. Compound Query

For example: Find/etc-size +102400-a-size-204800 Find files in/etc directory (greater than +) 50MB (102400) and-a (and meaning) (less than-) 100MB (204800)

-a means that two conditions are met

-O means two as long as one is satisfied

6. Search by File type

For example: Find-type f means file D means directory L link

7. Operation of search results

For example: Find/etc-name inittab-exec ls-l {} \; Perform ls-l operations on search results for find

-ok

8, according to I-node number search

Example: Find directory-inum i node number

Linux common commands (v)

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.