Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2005 10:01:42 -0400 (EDT)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        lists@natserv.com (Francisco Reyes)
Cc:        FreeBSD Questions List <questions@freebsd.org>, Dan Nelson <dnelson@allantgroup.com>
Subject:   Re: Looking for files older than n number of days?
Message-ID:  <200506061401.j56E1gJ4019888@clunix.cl.msu.edu>
In-Reply-To: <20050606095343.D86876@zoraida.natserv.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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.

I am not sure it is exactly a bug.  It seems to be dependant on how
find processes its parameters - in order of occurance.   A similar effect
can be seen with some other parameter combinations such as putting -print
in the wrong place - you can get all files in the system printed or none
rather than just what you want.   Possibly the man page needs to be
updated to make the effect of parameter order clear.

////jerry

> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506061401.j56E1gJ4019888>