Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get this output when checking the total amount of space I'm using on my Walkman.

david@Milton:/media$ du -b --max-depth=0 WALKMAN/
14823290693 WALKMAN/
david@Milton:/media$ du -k --max-depth=0 WALKMAN/
14523776    WALKMAN/

Last I checked, 14,523,776 KB * 1024 = 14,872,646,624 B, not 14,823,290,693 B. Dividing the two, their "K" unit seems to be equal to about 1020.62 rather than 1024 as advertised. This is causing some errors in the program I wrote to sync my Walkman, so it fills up faster than it claims to. Can anyone explain this discrepancy?

share|improve this question

du -b is described in the help documentation (du --help) as:

  -b, --bytes           equivalent to `--apparent-size --block-size=1'


      --apparent-size   print apparent sizes, rather than disk usage; although
                      the apparent size is usually smaller, it may be
                      larger due to holes in (`sparse') files, internal
                      fragmentation, indirect blocks, and the like

du -k, by contrast, provides

  -k                    'like --block-size=1K'

That is, du -k gives the disk usage of the file, while du -b gives the 'apparent size' of the file. The apparent size is usually (but not always) smaller.

(Source: coreutils bug report).

share|improve this answer
And if you’re checking the disk usage on your walkman, you almost certainly don’t want the apparent size but the actual size. – Claudius Oct 11 '12 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .