Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2005 10:27:06 -0400 (EDT)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        dnelson@allantgroup.com (Dan Nelson)
Cc:        FreeBSD Questions List <questions@freebsd.org>
Subject:   Re: Looking for files older than n number of days?
Message-ID:  <200506061427.j56ER6jZ019984@clunix.cl.msu.edu>
In-Reply-To: <20050606141635.GK255@dan.emsphone.com>

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.

Unfortunately, that kind of precise operational language blows right
by someone with not much experience with such things.    That is true
of many points of documentation.   It often takes some more conversational
type language to unlock the official language.

////jerry

> 
> -- 
> 	Dan Nelson
> 	dnelson@allantgroup.com
> 



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