find /etc -size -1G return only empty files

Patrick O'Callaghan pocallaghan at gmail.com
Sat Mar 27 14:13:05 UTC 2010


On Fri, 2010-03-26 at 15:58 -0500, Aaron Konstam wrote:
> On Fri, 2010-03-26 at 11:53 -0430, Patrick O'Callaghan wrote: 
> > On Fri, 2010-03-26 at 10:30 -0500, Aaron Konstam wrote:

[...]

> > > No, find -size 1G
> > > will do what you want.
> > 
> > Have you read the rest of this thread? Your interpretation of what the
> > OP wants is not what he says he wants, which in turn is not what "-size
> > -1G" actually does.
> > 
> > poc
> > 
> 
> I rfead the whole thread. And I agree that find -size -!G does not do
> what he wants but find -size 1G
> does. Try it and you will see.

I quote the OP's original message:

        find /etc -size -1G
        
        should return all files less than 1Giga byte in /etc, but return
        a
        list of empty file (size=0)
        
I think it's clear that he wants to find files of under 1Gb. That is not
what "find -size 1G" does. It gives a list of all files with non-zero
size, which is not the same thing.

poc



More information about the users mailing list