Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2005 09:16:35 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Jerry McAllister <jerrymc@clunix.cl.msu.edu>
Cc:        FreeBSD Questions List <questions@freebsd.org>
Subject:   Re: Looking for files older than n number of days?
Message-ID:  <20050606141635.GK255@dan.emsphone.com>
In-Reply-To: <200506061401.j56E1gJ4019888@clunix.cl.msu.edu>
References:  <20050606095343.D86876@zoraida.natserv.net> <200506061401.j56E1gJ4019888@clunix.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 06), Jerry McAllister said:
> > 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.

Correct.  Each primary returns 'true' or 'false', and the first 'false'
primary causes process to end for that file.

OPERATORS
     The primaries may be combined using the following operators.  The
     operators are listed in order of decreasing precedence.
[...]
     expression -and expression
     expression expression
          The -and operator is the logical AND operator.  As it is
          implied by the juxtaposition of two expressions it does not
          have to be specified.  The expression evaluates to true if
          both expressions are true.  The second expression is not
          evaluated if the first expression is false.

-- 
	Dan Nelson
	dnelson@allantgroup.com



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