Find and Remove Files Based on Date

Published by Torry Crass on

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.


Leave a Reply