删除目录下 某类名字的文件

 find . -name *appmap* -exec rm -r {} \;

 

 

[root@VM_61_158_centos fastdatav]# find . | grep yun
./services_files/yun6.html
./news_files/yun6.html
./contact_files/yun6.html
./partner_files/yun6.html
./faq_files/yun6.html
./invest_files/yun6.html
./index_files/yun6.html
[root@VM_61_158_centos fastdatav]# rm -r *yun6*
rm: cannot remove ‘*yun6*’: No such file or directory
[root@VM_61_158_centos fastdatav]# rm *yun6*
rm: cannot remove ‘*yun6*’: No such file or directory
[root@VM_61_158_centos fastdatav]# find . | grep yun | xargs rm -f
[root@VM_61_158_centos fastdatav]# find . | grep yun
[root@VM_61_158_centos fastdatav]# find . | grep yun | xargs rm -f

 

posted @ 2018-01-30 01:10  papering  阅读(179)  评论(0编辑  收藏  举报