How it works: Use the pipe command to find the files you want to delete in your home directory, then construct the parameter list using “xargs” and run the command.
Example 1: Delete all files with the suffix O in the current directory including subdirectories of the current directory
Example 1: Delete all files with the suffix O in the current directory including subdirectories of the current directory
find . -name "*.o" | xargs rm -f
Example 2: Remove all bak suffix files including subdirectories under /root
find /root -name *.bak | xargs rm -f
Command details reference:
Linux Shell LS Xargs RM Combined Delete File
https://blog.csdn.net/whatday/article/details/104027935
Read More:
- Delete files with specified suffix in specified folder under Linux
- Grep finds all files containing a string in Linux
- Find files with suffix. Sh under Linux
- Removing duplicate lines from Linux shell files
- Linux running Makefile, G + + / GCC error: suffix or operations invalid for ‘vbroadcasts’
- Error: cannot compute suffix of object files: cannot compile
- Perl application – delete “. SVN” folder in current directory and subdirectory
- Several methods of executing multiple commands in Linux shell
- Batch rename files on MAC (add prefix and suffix)
- In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment
- Several methods of deleting all empty lines in text under Linux
- Linux use ls to view the file color is all white solution, and Linux file color introduction
- Linux shell gets the file name under the folder
- Linux shell loop in a line for while
- The template tags of all vscode Vue files report errors in red~
- Java – read all the files and folders in a certain directory and three methods to get the file name from the file path
- Linux’s method of clearing DNS cache and refreshing DNS in shell terminal (Ubuntu, Debian)
- Failure [DELETE_ FAILED_ INTERNAL_ Error] and RM APK is unloaded
- An undetermined call to function ‘shell’: missing ‘. Stop. Problem encountered when using shell command in makefile
- Failure [DELETE_ FAILED_ INTERNAL_ After [error], RM APK is unloaded