linux 删除指定日期之前的文件

https://blog.csdn.net/zljjava/article/details/8351060

 

 

1 #!/bin/bash
2 find /home/tomcat/base/logs -mtime +30 -name "*.log" -exec rm {}\;

 

抄也能抄错。一个是windows下符号的问题,另外一个是结尾的问题。提示

 

find: missing argument to `-exec'

 

关键问题在这里。中间必须要要一个空格。

参考 https://blog.csdn.net/xiadingling/article/details/50770588

 

1 #!/bin/bash
2 find /home/tomcat/base/logs -mtime +30 -name "*.log" -exec rm {} \;

 

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2022-03-05
  • 2022-02-02
  • 2021-06-11
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2022-01-18
  • 2022-01-16
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案