This method can be used to delete a file with a suffix in a folder. Of course, the format of the file name can be defined by yourself, not necessarily by specifying a suffix, but by specifying a prefix, etc.
From: drizzle and glimmer
Method 1
Find Directory – name “*. ABC” | xargs RM
command is a bit dangerous, you can first execute the first half to see if it is the file you want to delete, and then execute the whole
method 2:
find. – name ‘*. Exe’ – type F – print – exec RM – RF {} \;
(1) “.” means to search recursively from the current directory
(2) “- name ‘*. Exe'” to search by name, all the folders or files ending with. Exe should be found
(3) “- type F” the type of search is file
(4) “- print” the directory name of the output search file
(5) The most important thing is – exec. The – exec option is followed by a command to be executed, which means that the command will be executed for the found file or directory.
The exec option is followed by the command or script to be executed, followed by a pair of {}, a space and a \, and finally a semicolon
Read More:
- Linux shell RM deletes all. O suffix files in the subdirectory
- Find files with suffix. Sh under Linux
- Perl application – delete “. SVN” folder in current directory and subdirectory
- Prompt 550 remove directory operation failed when FTP delete folder
- Method of modifying file and folder permission by Chmod command in Linux
- In J2EE Tomcat webapps, there are only folder directories and no files
- Error: cannot compute suffix of object files: cannot compile
- Golang gets the list of files under the folder
- Linux running Makefile, G + + / GCC error: suffix or operations invalid for ‘vbroadcasts’
- How to batch create folders in Excel form and copy the specified files to a new folder
- Batch rename files on MAC (add prefix and suffix)
- Error:No toolchains found in the NDK toolchains folder for ABI with prefix: mipsel-linux-android
- Linux view folder size, remaining disk space (DU / DF)
- Grep finds all files containing a string in Linux
- Solution: unable to delete folder (you need permission to perform this operation)
- Linux shell gets the file name under the folder
- Linux_ day07_ 05_ Configure common add, delete, modify and query commands in network
- How to delete the residual software files on the computer?
- Delete the specified crontab timer task under Linux
- The out folder does not appear under the idea project. Set the entire compilation information to the target folder