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