条件查找删除

1、查找超过30天未更新的目录并删除
find
./ -maxdepth 1 -ctime +30 -type d -exec rm -rf {} \;

2、除xxx不删,其他都删
ls |grep -v tldw-data-gov-1.2.0-SNAPSHOT.jar.24|xargs rm -f

3、只删xxx
find ./ -name "run.log.*" -exec rm {} \;

 

posted @ 2023-06-17 21:00  你说夕阳很美  阅读(7)  评论(0)    收藏  举报