Linux from Getting started to mastering (vi) (finding files Find)

Source: Internet
Author: User
Tags tmp file

Tag: Init owner tmp file property exe meaning PNG name modify property

1. Find files by name: Find file directory-name file name

Linux find is not a fuzzy query, but a precise search

If you want to blur the query, enter the command: Find/tmp-name *test*

Wildcard characters in 2.linux

    • * Match All
    • ? Match a single character
    • Use-iname case insensitive

3. Data blocks in Linux

1 Data block = 512 bytes = 0.5k, 1k = 2 data block

4. Find the file by size, command: Find directory-size [+n,-n,n]

    • +n represents greater than how many data blocks (n: Chunks)
    • -N represents less than how many blocks (N: Data blocks)
    • n is equal to how many blocks (N: Blocks of data)

For example: to find files larger than 100M in the system, the command is as follows:

5. Find file by Owner command: Find directory-user owner

Such as:

6. Find files by owning Group command: Find directory-group belongs to group

Such as:

7. Find files based on file attributes:

Find/etc-amin-5
Find files and directories accessed within 5 minutes in/etc

Find/etc-cmin-5
Find files and directories with properties modified within 5 minutes under/etc
The Ls-l property refers to the properties that are viewed by the

Find/etc-mmin-5
Find files and directories that have been modified within 5 minutes in/etc
Such as: added content at the end of the file

-5: Represents less than 5 minutes
+5: Represents more than 5 minutes

8. Find commands by File type: Find/etc-type [f,d,l]

    • F: File
    • D: Catalogue
    • L: Soft Link file

9. Finding files through Inode nodes: Find/etc-inum 123456

Find a file or directory with an inode node of: 123456

    • Typically used to delete files with spaces similar to "Program Files"
    • You can also use the Inode node to find hard links to files

10. Important:

10.1

10.2

11. Compound command:

Find/etc-name init*-a-type f-exec ls-l {} \;
In the ETC directory, look for the and type that starts with Init as a file and execute
Ls-l command.
\: Represents the translation character
; : Indicates the end

The difference between-exec and-ok is:-ok One more step to ask the link, that is y/n

Linux from Getting started to mastering (vi) (finding files 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.