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
- The command Du – h — max depth = 1 in Linux
- Failure [DELETE_ FAILED_ INTERNAL_ Error] and RM APK is unloaded
- Git – remove and trace files
- Perl application – delete “. SVN” folder in current directory and subdirectory
- Linux common problems and Solutions
- CMake_ Compiling VTK_ 9.0.0 running vtkcommoncolor DLL has access conflict
- Failure [DELETE_ FAILED_ INTERNAL_ After [error], RM APK is unloaded
- Linux shell gets the file name under the folder
- Delete the specified crontab timer task under Linux
- Common shell (1): shell gets the current time stamp of the system
- Grep finds all files containing a string in Linux
- VMware failed to lock memory file. Error restoring virtual machine state from file
- Common linux commands — find command’s Exec
- How to terminate the current program under linux command line?
- Prompt “XXX is” when debugging real machine busy:Processing symbol Files “and” Xcode will continue when XXX is finished“
- How to clean up the disk space of Linux server
- Solution to “An error occurred while loading the archive” appears when decompressing the rar file compressed package
- Method of modifying file and folder permission by Chmod command in Linux
- Solving environment: failed with initial frozen solve. Retrying with flexible solve.错误