一.根据文件名查找
查找path目录下文件名为fileName的文件:find [path] -name [fileName]
例如:find /home/admin -name ‘*.log’
二.删除n天前的所有日志文件
1天前 find [path] -mtime +1 -type f | xargs rm -rf
5天前 find [path] -mtime +5 -type f | xargs rm -rf
【
find [path] -mtime 2
】
查找文件更新日时在距现在时刻二天以内的文件
https://www.cnblogs.com/sandea/p/6457921.html
三. 删除距离今天n天的日志文件
距离今天1天 find [path] -mtime 1 -type f | xargs rm -rf