ZFS Compression – Understanding File Size with ZFS Compression on Solaris

compressionsolariszfs

I usually estimate the size of a whole directory tree using du -ks $DIRECTOY_TREE_ROOT, but this method cannot be used when zfs compression is on.

The total displayed by ls -l is ok for a single directory, but which is the simplest way to get the same result for a directory tree?

EDIT:

Operating system is Solaris 10.

I am looking for real file size, not the space used on disk.

Best Answer

This should just work:

find . -type f -exec ls -l {} + | nawk '{s=s+$5}
END {print s}'
Related Topic