Difference between revisions of "Delete files older than x days"
From Tech-Wiki
(Created page with " find . -type f -mtime +540 -exec rm {} \;") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Linux]] | ||
− | find | + | To exclude files older than 30 days: |
+ | find /var/log -type f -name '*.log' -mtime +30 -exec rm -f {} \; |
Latest revision as of 17:30, 23 February 2020
To exclude files older than 30 days:
find /var/log -type f -name '*.log' -mtime +30 -exec rm -f {} \;