Conflicting answers from du with different units

Posted by dpitch40 on Super User See other posts from Super User or by dpitch40
Published on 2012-06-08T03:04:06Z Indexed on 2012/06/08 4:42 UTC
Read the original article Hit count: 305

Filed under:
|
|

My question is quite simple. 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. 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 discrepency?

© Super User or respective owner

Related posts about linux

Related posts about disk-space