Delete files older than x days
From Tech-Wiki
More actions
Technical reference for Delete files older than x days.
Review the impact before execution
This page contains commands or procedures that can remove data or materially change system state. Confirm the target, change plan and recovery path before use.
To exclude files older than 30 days:
find /var/log -type f -name '*.log' -mtime +30 -exec rm -f {} \;