Linux Bulk Delete file directory lookup file __linux

Source: Internet
Author: User
Bulk delete files in a specified directory

Deletes all files at the end of the. Log in the current directory
Find. -name "*.log"-exec rm-rf {} \;

Note:
There is a space between 1.{} and \
2.find. There are also spaces between the-name
3.exec is a subsequent command, {} content represents the previously found file

Delete files in the current directory that were modified 1 days ago
Find. -mtime +1-name "*"-exec rm-rf {} \;

Delete files in the current directory that were modified 60 minutes ago
Find. -mmin +60-name "*"-exec rm-rf {} \; File Content Lookup

Find all files in the current directory that are of type file, with a filename suffix of class
Find. -type F-name *class

Note: type parameter-f means file-D refers to directory

Find the file name for all files in the current directory containing the ABCD string
Find./-type f-exec grep-il abcd {} \;

Note: the-I value ignores the keyword case; -L only lists matching filenames

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.