标签: directory find
我目前正在使用以下代码删除旧日志文件
df -k /opt/logs/ ; find /opt/logs/*[.]log[.]* -mtime +5 -exec /bin/rm -fv {} \;
但是find命令没有在子目录中搜索 *.log.* 文件。我怎样才能在子目录中进行搜索
*.log.*
答案 0 :(得分:0)
正确的查找语法应为:
find /opt/logs -name "*.log.*" -mtime +5 -exec /bin/rm -fv '{}' \;