Reputation: 24621
How do I recursively delete files in directory that were modified more than 6 hours ago?
This example work for 1 day:
find /data2/input -type f -mtime +1 -delete -print
Upvotes: 1
Views: 558
Reputation: 1434
Use -mmin
instead of mtime
. It will allow you to specify the number of minutes since the files was last modified. So for files older than 6 hours:
find /data2/input -type f -mmin +360 -delete -print
Upvotes: 3