find mtime not the same as ls mtime?

Stephen Ryan stephen at sryanfamily.info
Fri Mar 13 12:39:48 EDT 2009


On Fri, 2009-03-13 at 12:10 -0400, Alan Johnson wrote:
> I think my brain is melting.  Any find gurus out there that answer
> this question: what stupid thing am I doing wrong here?
> ajohnson at ajohnson-laptop:~/performance/wslavedb1$ ls -lt | tail -n 5
> -rw-r--r-- 1 ajohnson ajohnson  222305 2008-10-01 12:00
> 2008-10-01_0800.vmstat.gz
> -rw-r--r-- 1 ajohnson ajohnson   63367 2008-10-01 08:00
> 2008-10-01_0400.queryStates.gz
> -rw-r--r-- 1 ajohnson ajohnson  231492 2008-10-01 08:00
> 2008-10-01_0400.vmstat.gz
> -rw-r--r-- 1 ajohnson ajohnson   54066 2008-10-01 04:00
> 2008-10-01_0000.queryStates.gz
> -rw-r--r-- 1 ajohnson ajohnson  214223 2008-10-01 04:00
> 2008-10-01_0000.vmstat.gz
> ajohnson at ajohnson-laptop:~/performance/wslavedb1$ find . -mtime 60
> ajohnson at ajohnson-laptop:~/performance/wslavedb1$ 
> 
> WTF?  Thanks in advance for any help.

Those files were last modified more than 60 days ago.  "find . -mtime
60" will only find files that were last modified exactly 60 days ago,
which would be January 11th.
-- 
Stephen Ryan
Dartware, LLC



More information about the gnhlug-discuss mailing list