Skip to content

Comment on Why is 1 GB equal to 10^9 bytes instead of 2^30?parent

Comments

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)
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.