Linux Delete Files Older Than X Days

Remove files in the current directory that are older than X days. This can make a handy cron job when certain applications store files to a disk cache but door a poor job of removing them.
find . -mtime +X -exec rm {} \;

#example - remove files older than 90 days

find . -mtime +90 -exec rm {} \;
Posted by
Snippet Viewed 2085 times.

Share your Linux code snippets:

  • Get some recognition & link back to your site.


Submit | Browse

Most Recent linux snippets

Most Viewed