Common commands for file search in Linux and Common commands for linux

Source: Internet
Author: User

Common commands for file search in Linux and Common commands for linux

File SEARCH Command: find

1. Search by file name

1.1. Search for precise files

Find path-name file name

1.2. Search for a file whose file name contains a string.

Find path-name * file name *

1.3. Search for files prefixed with a string.

Find path-name file name *

1.4. Search for files suffixed with a string.

Find path-name * file name

1.5. Search for the file name you want to match ,? Match any single character

Find path-name file name ???

1.6 search for files without case sensitivity

Find path-iname file name

2. Search by file size

Default size unit: data block: 1 data block = 512 bytes

2.1. Search for files larger than MB in the path

Find path-size + 204800

2.2. Search for files smaller than MB in the path

Find path:-size-204800

3. Search by owner

3.1. Search for all files of the owner in this path.

Find path-user Username

4. Search by group

4.1. Search for all the files in this group under this path.

Find path-group name

5. Search for files by Time

-Amin: access-cmin: file property (change): The property seen by ls-l-mmin: File Content (modify)

5.1. Search for the files and directories accessed in the path within five minutes.

Find path-amin-5

5.2. Search for the files and directories in the path that have been modified within 5 minutes.

Find path-cmin-5

5.3. Search for the files and directories in the path that have been modified within 5 minutes.

Find path-mmin-5

6. find connection options

-A: two conditions are met at the same time-o: either of the two conditions can be met.

6.1. Search for files larger than 80 m and smaller than m

Find path-size + 163840-a-size-204800

6.2 search for the inittab file in the path and display its details

Find path-name inittab-exec ls-l {}\;

VII. Others

7.1.-type search by file type

F File d directory l soft link file

Only find the file with the corresponding file name

Find path-name file name-a-type f

7.2-inum search by I Node

Find path-name file name-a-inum

Related Article

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.