Date: Sat, 1 Nov 2003 11:14:09 +1030 From: Malcolm Kay <malcolm.kay@internode.on.net> To: David Carter-Hitchin <david@carter-hitchin.clara.co.uk>, Drew Tomlinson <drew@mykitchentable.net> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: Help With 'find' Syntax Message-ID: <200311011114.09213.malcolm.kay@internode.on.net> In-Reply-To: <Pine.BSF.4.21.0311010038570.656-100000@localhost> References: <Pine.BSF.4.21.0311010038570.656-100000@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Nov 2003 11:34, David Carter-Hitchin wrote: > Hi Drew, [snip] > You may find the following note from man find helpful: > > # All primaries which take a numeric argument allow the number to be pr= e- > # ceded by a plus sign (``+'') or a minus sign (``-''). A preceding pl= us > # sign means ``more than n'', a preceding minus sign means ``less than = n'' > # and neither means ``exactly n''. > > So that is why I put a "+" in from of 1024 - to find files over 1024 by= tes > (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=20 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' bran= ch 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 t= he=20 -size +100 should be applied *before* the -ls. (It is difficult to see why Drew would want to use both -ls and -print) > and I don't > know why they were found - I can replicate this on my machine here, but= I > don't know why - perhaps it is the file allocation. This is why I chos= e > 1024c instead of block size. > Malcolm Kay
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311011114.09213.malcolm.kay>