Linux commands (13) Delete files with the same suffix name under the specified folder

Source: Internet
Author: User

Method One:

Find directory-name "*.ABC" | Xargs RM
command is a bit dangerous, you can do the first half to see if you want to delete the file, and then the entire execution

Method Two:
Find. -name ' *.exe '-type f-print-exec rm-rf {} \;
(1) "." Represents a recursive lookup starting from the current directory
(2) "-name ' *.exe '" to find all folders or files ending with an. exe by name
(3) "-type F" Lookup type is file
(4) "-print" output to find the file directory name
(5) The main thing is-exec, the-exec option is followed by a command to execute, indicating that the command will be executed by the find file or directory.
The EXEC option is followed by the command or script that you want to execute, followed by a pair of {}, a space and a \, and finally a semicolon

Linux commands (13) Delete files with the same suffix name under the specified folder

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.