找到所有的txt文件并删除

1.find /oldboy/ -type f -name "*.txt" -delete

2.find /oldboy/ -type f -name "*.txt"  -exec rm -f {} ;

3.find /oldboy/ -type f -name "*.txt" | xargs rm-f;

4.rm -rf$(find /oldboy/ -type f -name "*.txt" );

原文地址:https://www.cnblogs.com/huangfeng666/p/12160068.html