Help With 'find' Syntax
drew at mykitchentable.net
Sat Nov 1 07:09:09 PST 2003
> ----- Original Message -----
> From: "Malcolm Kay" <malcolm.kay at internode.on.net>
> To: "David Carter-Hitchin" <david at carter-hitchin.clara.co.uk>; "Drew
> Tomlinson" <drew at mykitchentable.net>
> Sent: Friday, October 31, 2003 4:44 PM
> On Sat, 1 Nov 2003 11:34, David Carter-Hitchin wrote:
> > Hi Drew,
> > You may find the following note from man find helpful:
> > # All primaries which take a numeric argument allow the number to be
> > # ceded by a plus sign (``+'') or a minus sign (``-''). A preceding
> > # sign means ``more than n'', a preceding minus sign means ``less than
> > # and neither means ``exactly n''.
> > So that is why I put a "+" in from of 1024 - to find files over 1024
> > (c).
> > So in your example below:
> > > find /usr \( -mtime 6 -ls -size 100 \) -o \( -ctime 6 -ls -size 100
> > > \) -print
> > You are trying to find files that are exactly 100 512k blocks in
> > size. Admittedly the files you found were not of this size
> At each stage find applies the test argument and passes on files that
> remain to the next argument for manipulation. This in the first 'or'
> everthing that satisfies -mtime 6 is passed on to -ls and thus displayed
> before it is filtered by the -size 100 argument. To do what Drew wanted
> -size +100 should be applied *before* the -ls.
Thank you. Now I understand.
> (It is difficult to see why Drew would want to use both -ls and -print)
Because I don't know what I'm doing. :) Thanks for pointing out that this
More information about the freebsd-questions