Shell's Find command detailed

Source: Internet
Author: User

Note: ". "There are spaces around the dot number.

1. Find-name "*.txt"

Find the file that ends with txt in the current directory (and subdirectory).

2. Find-name "[a-z]*"

Find the file that starts with all letters under the current directory (and subdirectories).

3,find/etc-name "host*"

Find the file that starts with host in the/etc directory.

4,find.-perm 755

Locate the file with the property 755 under the current directory (and subdirectories).

5.Find-user Root

Find the file under the current directory (and subdirectories) that belongs to the main root .

6,find/var-mtime-5

Find files that are within 5 days of the change time under/var.

7,find/var-mtime +3

Find the file under/var to find the change time 3 days ago .

8,Find/etc-type D

Look for a directory file of type D under/etc.

9,find/etc-type l

Find the file type in/etc for | The link file.

10,find.-size +1000000c

Look for files larger than 1M in the current directory (and subdirectories),1M is 1 million bytes .

11. Find-perm |xargs chmod 777

Locate All files with permissions of 700 under the current directory (and subdirectories) and reset their permissions to 777.

12. Find-type F |xargs ls-l

Find the file and view its details.

Shell's Find command detailed

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.