Le 21 déc. 09 à 20:23, Joerg Schilling a écrit :

Matthew Ahrens <matthew.ahr...@sun.com> wrote:

Gaëtan Lehmann wrote:

Hi,

On opensolaris, I use du with the -b option to get the uncompressed size
of a directory):

 r...@opensolaris:~# du -sh /usr/local/
 399M    /usr/local/
 r...@opensolaris:~# du -sbh /usr/local/
 915M    /usr/local/
r...@opensolaris:~# zfs list -o space,refer,ratio,compress data/ local NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
REFER  RATIO  COMPRESS
data/local 228G 643M 249M 394M 0 0
394M  2.51x        on
 r...@opensolaris:~# which du
 /usr/gnu/bin/du

but on Solaris 10, there is no such option.

So what is the best way to get the uncompressed size of a directory on
Solaris 10?

Install GNU du on solaris 10?  Although the answer will be just as
(in)accurate as GNU du on solaris 10. Note that it reports the compression

How about:

find . -type f -ls | awk '{ sum += $7} END {print sum}'


sounds good

r...@opensolaris:~# find /usr/local/ -ls | awk '{sum += $7} END {print sum/1024**2}'
  914.039

but maybe a little longer to write

  r...@opensolaris:~# echo "du -sbh ." | wc -c
  10
r...@opensolaris:~# echo "find . -ls | awk '{sum += $7} END {print sum/1024**2}'" | wc -c
  53

Thanks!

Gaëtan

--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.itk.org
http://www.mandriva.org  http://www.bepo.fr

Attachment: PGP.sig
Description: Ceci est une signature électronique PGP

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to