Search code examples
linuxdiskspace

Linux du directory size, how is this possible?


I have a folder called joblibSCRATCH. I do and see this

ubuntu@memo:~$ du -s joblibSCRATCH
2831128 joblibSCRATCH

This is 2831128 kilobytes, which is 2.836024GB. I then do and see this

ubuntu@memo:~$ du -hs joblibSCRATCH
2.7G    joblibSCRATCH

So du is saying that this folder is both 2.7GB and 2.83 GB. How can this be? If it makes any difference I'm using a virtual hard drive on a cloud server.


Solution

  •  2831128 / 1024 = 2764.7734375
     2764.7734375 / 1024 = 2.69997406005859375