The difference with and without
-h should only be the human readable units, right?
Well apparently no...
$ du -s . 74216696 . $ du -hs . 35G .
Or maybe I'm mistaken and the result of
du -s . isn't in KB?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
du without an output format specifier gives disk usage in blocks of 512 bytes, not kilobytes. You can use the option
-k to display in kilobytes instead. On OS X (or macOS, or MacOS, or Macos; whichever you like), you can customize the default unit by setting the environment variable
BLOCKSIZE (this affects other commands as well).