Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 2008 18:42:52 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        lhmwzy <lhmwzy@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: zfs quota question
Message-ID:  <20081008183552.W16723@sola.nimnet.asn.au>
In-Reply-To: <78fb9d960810080019j3b73e3ffidc189c716fb7a1de@mail.gmail.com>
References:  <E1KnA2b-0007ls-8u@dilbert.ticketswitch.com> <200810071314.45922.max@love2party.net> <48EB5ADD.2090900@modulus.org> <78fb9d960810072118k47a64097yaa486ef5179efb1@mail.gmail.com> <20081008165835.C16723@sola.nimnet.asn.au> <78fb9d960810080019j3b73e3ffidc189c716fb7a1de@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Oct 2008, lhmwzy wrote:
 > OK.It's my mistake.
 > Improve it again:
 > 
 > #!/bin/sh
 > find $1 -type f -ls  | awk '{j += $7} END {printf("%.2fM\n",j/1024/1024)}'

Sure.  Here it runs about 7% faster precalculating one division:

$ time find . -type f -ls  | awk '{j += $7} END {printf("%.2fM\n",j/1048576)}'
        2.69 real         0.64 user         1.21 sys
6586.34M

 > > $ du -d0 .
 > > 6781976 .
 > >
 > > Took 1.5 seconds, and comes to 69447434424, ie bytes allocated for those

And my mistake, transcribing from the calculator: should be 6944743424.

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081008183552.W16723>