bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug.


From: Paul Eggert
Subject: Re: Possible bug.
Date: Mon, 17 Jan 2005 01:18:36 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden (Harley D. Eades III) writes:

> While creating a file to use for debugging parted I used the command
> `head -c 10m /dev/zero > ./gnu' then used `ls -sh ./gnu' to confirm
> the 10m file was created and noticed ls reported it as 11m.

ls -s reports the amount of disk space consumed by the file, which is
typically more than the number of bytes that you see when you read the
file, due to file system overhead.

>       Append a size letter to each size, such as `M' for mebibytes.
>
> There is a typo in `info ls' as you can see above mebibytes, should that be
> megabytes?

No, "mebibytes" means 2**20 bytes, whereas "megabytes" means 10**6
bytes.  This is explained in the "Block size" node of the
documentation; see <http://physics.nist.gov/cuu/Units/binary.html>.

> /bin/head -c 1m /dev/zero > test
> /bin/ls -sh ./test
> 1.1M ./test

Here's what I got; it may help explain things.

$ export LC_ALL=en_US
$ head -c 2m /dev/zero > test
$ ls -shl test
2.1M -rw-r--r--  1 eggert eggert 2.0M 2005-01-17 01:13 test
$ ls -sl --block-size="'1" test
2,101,248 -rw-r--r--  1 eggert eggert 2,097,152 2005-01-17 01:13 test




reply via email to

[Prev in Thread] Current Thread [Next in Thread]