find /etc -size -1G return only empty files
Aaron Konstam
akonstam at sbcglobal.net
Sun Mar 28 12:39:08 UTC 2010
On Sat, 2010-03-27 at 18:43 -0430, Patrick O'Callaghan wrote:
> On Sat, 2010-03-27 at 15:34 -0500, Aaron Konstam wrote:
> > > 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
> > >
> >
> > Ok, lets settle this. Do you know what you say to be true? Have you
> > tested it on files larger than 1G? I have no files that big so I
> > can't test it.
>
> I said nothing about files larger than 1G. My remarks were in relation
> to files of non-zero size.
>
> In any case, testing this is easy:
>
> $ mkdir tst
> $ cd tst
> $ touch a
> $ dd if=/dev/zero obs=1c count=1 of=b
> $ dd if=/dev/zero obs=1c count=1 seek=1073741824 of=c
> $ ls -l
> total 8
> -rw-rw-r-- 1 poc poc 0 2010-03-27 18:34 a
> -rw-rw-r-- 1 poc poc 512 2010-03-27 18:34 b
> -rw-rw-r-- 1 poc poc 1073742336 2010-03-27 18:34 c
> $ find tst -size -1G
> a
> $ find tst -size 1G
> b
> $ find tst -size +1G
> c
>
> IOW, the "-size 1G" variant lists files of size greater than zero and not greater than 1G.
>
> poc
>
Well we finally agree. Hurrah :-)
--
=======================================================================
has /usr/bin/emacs been put into /etc/shells yet? :P
=======================================================================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam at sbcglobal.net
More information about the users
mailing list