Linux bash-File Lookup

Source: Internet
Author: User

Locate

    • Role

Non-real-time fuzzy query file, according to the whole system file database query.

Using the UpdateDB command to manually generate a file database is time-consuming.

Find

    • Role

A real-time, accurate query of files, which is slower by traversing all files in the specified directory to complete lookups. Support for many search criteria.

Find Find Path Lookup criteria finds a later processing action

The lookup path defaults to the current directory, and the lookup criteria default to all files under the specified path, and the processing action is displayed by default.

    • Matching Criteria

-name ' FileName ': Exact match according to the file's masterpiece. Supports file name wildcard.

-iname ' filename ': matches by file name. File names match when they are not case-sensitive.

-regex Pattern: Implements file lookups based on patterns.

-user USERNAME: Based on the file belongs to the main implementation file lookup.

-group GROUPNAME: Implement file Lookup According to the file genus Group.

-uid UID: Based on UID lookup.

After the user deletes, the owner of the file to which it belongs is changed to the UID of the user.

-gid GID: Search by GID.

-nouser: Find files that are not owned by the master.

-nogroup: Finds files that do not belong to a group.

-type: Search by file type.

F: Normal file.

D: Directory.

C: Character device file.

B: Block device files.

L: Link file.

S: Socket file.

P: Pipeline file.

-size: Finds files based on file size.

[+|-] #k.

[+|-] #M.

[+|-] #G.

-mtime days: Find files based on modified time.

+: The number of days before the file has been accessed.

-: The file has been accessed within the number of days.

Days: Files have been accessed in just a few days.

-ctime days: Find files based on change time.

-atime days: Find files based on access time.

-mmin minutes:

-cmin minutes:

-amin minutes:

-perm Permission information:

Mode: Exact match.

-mode: Every bit must match. Only file permissions can be matched if this mode is fully contained.

/mode: As long as there is one permission match.

Combination condition: Default to Logical

-A: With.

-O: Or.

-not: Non-.

Action:

-print: Display.

-ls: Displays detailed information for each file in a form similar to ls-l.

-ok COMMAND {} \;: Performs the appropriate action on the queried file. User confirmation is required for each operation.

-exec COMMAND {} \;: Performs the appropriate action on the queried file. No user confirmation is required.

| Xargs COMMAND:

Linux bash-File Lookup

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.