Linux Learning Search Command find

Source: Internet
Author: User

1. Find-name Find Files by name

    • * Wildcard all characters;
    • ? Wildcard single character

2. Find-iname is case-insensitive by name

3. find-size according to file size

    • Find/-size +2048000 greater than 100m;# + means more than
    • Find/-size-2048000 less than 100M: #-Indicates less than
    • Find/-size n2048000 equals 100M; # n means equals

4, Find-user/group According to create a user name or group to find files

5. find-cmin-5 Find files and directories that have been modified in 5 minutes

    • -amin: Accessing Time Access
    • -cmin: File attribute change
    • -mmin: File content Modify


6, find-type:f file, d directory; l link

7, find find to link multiple conditions,-a two conditions at the same time,-o two conditions to meet any one
Find/etc-size +1024000-a-size-2048000

8. Find "directory"-name "FileName"-exec [Execute command] {} \ (for example: Find/etc-name inittab-exec ls-l {} \;)

    • -exec/ok represents the command to be executed later, when OK is executed, each queried record asks for an action if the operation is performed.
    • {} indicates that the result of Find lookup is realized
    • \ means escape character
    • ; Indicates the end of a command

For example:
[Email protected] test_paul]# Ll/mnt/test_paul
Total 4
-rw-r--r--. 1 root root Jan 06:21 test.sh
[Email protected] test_paul]# Find/mnt/test_paul-type d-exec ls-l {} \;
Total 4
-rw-r--r--. 1 root root Jan 06:21 test.sh

9. Find "directory"-inum "num": Based on the file I node, num is the I node of the file

Search for Linux learning command find

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.