Looking for files older than n number of days?

Francisco Reyes lists at natserv.com
Mon Jun 6 13:56:12 GMT 2005


On Sun, 5 Jun 2005, Dan Nelson wrote:

>> I ran it on a directory and was surprised to find that both -5 AND +5
>> listed a file from February. :-(
>
> -5 definitely should not, and doesn't on my system.  It should be
> interpreted as "less than 5 days from midnight tonight".

I think I found a bug in find.
If you add the '-ls' parameter before the -mtime it ignores mtime.
Example:
find . -ls -mtime -5d
Shows all files in directory.


find . -mtime -5d -ls
Shows correctly files modified less than 5 days old.


More information about the freebsd-questions mailing list