0

Find and Remove Files Based on Date

To find and execute a command to remove files based on the file creation date use:

find . -ctime +365 -exec rm {} \;

Note: you can substitute -ctime (created) for -mtime (modified) and -atime (accessed).  You can also change the exec command to something like ls -ltr if you are looking to simply list files.

Torry Crass

Leave a Comment