From owner-freebsd-questions@FreeBSD.ORG Fri Oct 31 16:44:20 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A12D116A4CF for ; Fri, 31 Oct 2003 16:44:20 -0800 (PST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3462643FE0 for ; Fri, 31 Oct 2003 16:44:19 -0800 (PST) (envelope-from malcolm.kay@internode.on.net) Received: from beta.home (ppp107-193.lns1.adl1.internode.on.net [150.101.107.193])hA10i9Tn073056; Sat, 1 Nov 2003 11:14:10 +1030 (CST) Content-Type: text/plain; charset="iso-8859-1" From: Malcolm Kay Organization: At home To: David Carter-Hitchin , Drew Tomlinson Date: Sat, 1 Nov 2003 11:14:09 +1030 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200311011114.09213.malcolm.kay@internode.on.net> cc: FreeBSD Questions Subject: Re: Help With 'find' Syntax X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2003 00:44:20 -0000 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