in reply to Re: Total size of each Directory
in thread Total size of each Directory

As other monks have mentioned, there is always the venerable unix du utility. This tells how much actual disk space is being used by the files, as opposed to the combined size of the files. Pretty handy. (Though, also noted by another monk, sometimes it's useful to simply know the total combined size of some files. e.g. for burning to a cd or creating a tar.)

Replies are listed 'Best First'.
Re: Re: Re: Total size of each Directory
by bart (Canon) on Jul 28, 2003 at 22:41 UTC
    Both CD-ROMs and tar files use sector blocks.

    For tar files, the block size is 512 bytes.

    The block size on a CD is a somewhat over 2300 bytes. For data, the surplus is used for error detection and correction, so the block size for actual data is 2048 bytes. For details, take a look here or here.

    Thus, in summary, for both CD-ROM and for tar files, to get the actual size on disk disk, you need to apply the same calculations, but with different sector sizes than those that apply to the harddisk.

      I see. So the reason a sum-of-all-file-sizes seems more accurate for cd filesystems and tar files is not that they don't use blocks, just that they use much smaller blocks than most hard disk filesystems? I knew the numbers never worked out perfectly, but never bothered to investigate why. Thanks for this info. bart++