Difference between revisions of "Delete files older than x days"

From Tech-Wiki
Jump to: navigation, search
(Created page with " find . -type f -mtime +540 -exec rm {} \;")
 
Line 1: Line 1:
 +
[[Category:Linux]]
  
find . -type f -mtime +540 -exec rm {} \;
+
To exclude files older than 30 days:
 +
find /var/log -type f -mtime +30 -exec rm {} \;

Revision as of 22:13, 23 October 2017


To exclude files older than 30 days:

find /var/log -type f -mtime +30 -exec rm {} \;