Find Command Usage Introduction

Source: Internet
Author: User

There are two ways to find files: Locate and find:
Locate:non-real-time, fuzzy matching, lookup is based on the system-wide file database;
updatedb the command to generate the file database manually, it may be slow to build the database
Advantages: Fast speed

Find: Real Time
Precise
support for many search criteria
traverse All files in the specified directory to complete the lookup, slow;

command format: Find Find Path Lookup criteria finds a later processing action
1. Find the path: default to the current directory
2. Find criteria: Default to all files under the specified path
3. Handling actions: Default to display (Print to screen)

Match (Find) criteria:        -name ' FILENAME ': exact matching of file masterpieces
        The file name supports a wildcard:
                *: Any character of any length
                ?:
                []:
        -iname ' filename ': file name matching does not support case
        -regex PATTERN: File name matching based on regular expressions

        -user USERNAME: Search According to the owner of the file
        -uid UID: Search by UID
        -gid GID: Search by GID
        -nouser: Finding users who are not owned by the master
        -nogroup: Finding files that are not owned by a group

        -type:
                F: Normal file
                D:
                C:
                B:
                L
                P:
                S

        -size:
                #k:
                #M:
                #G:
                The above unit can be preceded by a [+|-] identifier, + = greater than,-represents less than

        Combination conditions:
                -A
                -O
                -not

                -mtime
                -ctime
                -atime
                [+|-]#
                -mmin
                -cmin
                -amin
                [+|-]#

        -perm MODE
                /mode: Only one match can be
                -mode: File permissions can only be displayed when the MODE is fully contained

Action:-print: (default) display
-ls: Displays detailed information for each file in a form similar to Ls-l
-ok COMMAND \; Must be "\;" End, every operation needs to be confirmed
-exec COMMAND {} \; Must be "\;" End, operation without confirmation

Find Command Usage Introduction

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.