2
$ sudo du -h -d 0 home/ 309G home/ $ df -h Filesystem Size Used Avail Use% Mounted on ... /dev/sda4 550G 309G 214G 60% /home ... 

System Monitor on Ubuntu shows the used space on /home is 331.1 GB

enter image description here

Do the different ways measure the same thing?

How differently do they make the measurements?

Thanks.

0

2 Answers 2

1

It is two different units. The larger number is in gigabytes. 1 gigabyte = 1 billion bytes. The smaller number is in gibibytes. 1 gibibyte = 1,073,741,824 bytes = 2^30 bytes

1

It's the same measurement. 309 Gb is the size specified in powers of 2 (the ugly-named Gibibyte), while 331 Gb is the size specified in powers of 10 according to the SI (Gigabyte).

309 Gb (in powers of 2) * 1024 * 1024 * 1024 = 331786223616 bytes i.e. 331 Gb (in powers of 10).

As pointed out by @don_crissti, df -h prints values in binary powers. If you had run df -H, which uses decimal powers instead, it would have printed 331 Gb of used space.

For more information, see https://en.wikipedia.org/wiki/Binary_prefix .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.