find /etc -size -1G return only empty files
Patrick O'Callaghan
pocallaghan at gmail.com
Thu Mar 25 15:16:17 UTC 2010
On Thu, 2010-03-25 at 10:19 -0400, Kevin J. Cummings wrote:
> On 03/25/2010 02:45 AM, Ala1n Sp1neu8 wrote:
> > Hello
> > find /etc -size -1G
>
> Get rid of the "-" before the 1G....
>
> > should return all files less than 1Giga byte in /etc, but return a
> > list of empty file (size=0)
> >
> > find /etc -size -2G
> >
> > work fine and return all the files
> >
> > This works the same on my fedora11 and my centos 5 !
> >
> > Did I miss something or is it a bug ?
>
> You missed something. B^)
>From "info find":
The number can be prefixed with a `+' or a `-'. A plus sign
indicates that the test should succeed if the file uses at least N
units of storage (a common use of this test) and a minus sign
indicates that the test should succeed if the file uses less than
N units of storage. There is no `=' prefix, because that's the
default anyway.
Note that this clarification is not present in the man page find(1). So
it's either a bug in find or a bug in the documentation.
poc
More information about the users
mailing list