I have a directory with a few TB of files. I'd like to delete every file in it that is older than 14 days.
I thought I would use find . -mtime +13 -delete
. To make sure the command works as expected I ran find . -mtime +13 -exec /bin/ls -lh '{}' \; | grep '<today>'
. The latter should return nothing, since files that were created/modified today should not be found by find
using -mtime +13
. To my surprise, however, find
just spew out a list of all the files modified/created today!