Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does any operating system or commonly used program report file sizes in terms of 1 GB = 10^9 bytes? As far as I know they all use GiB and MiB, whether they call it that or not.


Linux is all over the place. For example:

    $ dd if=/dev/zero of=/dev/null bs=1M count=1K
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 0.157131 s, 6.8 GB/s
'dd' interprets command-line arguments "M" and "K" as 2^20 and 2^10 respectively, but when it reports the total amount copied, it uses the decimal GB (10^9). It also uses decimal SI units in the average speed calculation.

My favorite file manager, Thunar, reports file sizes in decimal units. Not sure if it's distro-specific, though.

Many other programs, like 'df', have a switch (--si) that turns decimal units on or off.


OSX has switched to 10^9 bytes a few iterations ago.


I remember seeing a French Mac many years ago (pre-OS X). I don't know what kind of mega it used (there was no giga back then), but file sizes were reported as "Mo" rather than "MB", for "mega-octets", "octet" being the French word for byte. It sounded much classier to me.

Of course, aficionados of RFCs will know that "octet" is (or at least was) the preferred term for "byte" in IETF documents as well. I don't think this is because the RFC editor was secretly French, although i'm sure he was thoroughly classy; presumably it's because early RFCs were written in the era when the byte had not quite settled down at eight bits, and needed to be unambiguous.


Snow Leopard apparently, which was released in 2009. Ubuntu's policies on the subject seem to be about the same age.

I suppose I should've said that up until five years ago, nearly everyone was using powers of two for file sizes. And Windows/Mac never used the correct prefixes.


http://blogs.msdn.com/b/oldnewthing/archive/2009/06/11/97253...

It's a tricky topic and as Raymond correctly points out, giving people a term that they don't understand probably serves little to no good purpose.


I don't think that giving the users something that _is_ wrong is a better solution... Why not switching to GiB? Power users would understand, and others wouldn't even notice!


Why not switch to actual GB like the OS X did. I'm not sure why anybody prefers GiB.


Either way, as long as GB = 10^9, and GiB = 2^30


It depends, sometimes it's even switchable, e.g. take df.

    $ df -k /
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda3      151798672 47602008 102615608  32% /

    $ df -h /
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda3       145G   46G   98G  32% /

    $ df -H /
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda3       156G   49G  106G  32% /
(-h "human readable" with powers of 2^10, -H "human readable" with powers of 10^3)

$ df --version df (GNU coreutils) 8.22

ls has -h/--si/-k ...

    $ ls -h -l /proc/kcore 
    -r-------- 1 root root 128T Apr  6 19:02 /proc/kcore
    $ ls --si -l /proc/kcore 
    -r-------- 1 root root 141T Apr  6 19:03 /proc/kcore
(/proc/kcore is 2^47 = 140737488355328 = 128 * 2^40 = 128 TiBi bytes)


Windows uses GiB, but displays GB. On Linux, most tools uses standard SI (1000 = K, 1024 = Ki), but not all of them...


XFCE (Thunar) uses SI units (just verified against ls -l).


Nautilus and Thunar (to name a few) in Ubuntu use SI prefixes.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: