[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "du -k" and "du -b" inconsistent output
From: |
Eric Blake |
Subject: |
Re: "du -k" and "du -b" inconsistent output |
Date: |
Thu, 19 Oct 2006 18:55:47 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Miguel Barão on 10/19/2006 9:47 AM:
> This not a bug but rather an inconsistent output between these two du
> options,
> which is not documented in the manpages.
Read the info documentation instead, where it talks about sparse files.
>
> Suppose 'somefile' is a file containing a lot of zeros.
>
> Then I get:
> $ du -k somefile
> 12
> $ du somefile
> 12
> $ du -b somefile
> 4194432
>
> It seems that du -b is returning the size of the file, and not the "disk
> usage" of that file.
As it should, since -b implies --apparent-size, and a sparse file will
have a larger apparent size than disk usage size.
>
> (Using coreutils-5.94, linux on both reiserfs and ext3)
Consider upgrading - the latest stable version of coreutils is 6.3.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFOB6T84KuGfSFAYARAhdQAJ4/XcP0EFdt7EIiqXCgImf9iqT28ACeNpus
R8OipmCABgFrcWyMNjSO/hQ=
=Oyrf
-----END PGP SIGNATURE-----