按时间删除命令:

删除当前目录下30天以前的所有文件:
find . -type f -ctime +30 -exec rm -fr {} \;
 
删除当前目录下30天以前的所有目录:
find . -type d -ctime +30 -exec rm -fr {} \;
 
删除/oracle/123目录下3天以前的文件:
find /oracle/123 -type f -ctime +3 -exec rm -rf {}\ ;
 
删除当前目录下30天以前,名称匹配"*awr*.html"的文件:
find . -type f -name "*awr*.html" -ctime +30 -exec rm -fr {} \;

 

相关文章:

  • 2021-05-19
  • 2022-01-03
  • 2021-05-27
  • 2022-02-15
  • 2021-08-31
  • 2021-11-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
相关资源
相似解决方案