I know that the command du -csbh will show you the actual file size of a directory.

This will be displayed as: 241 MB which is fine.

If I look in windows 10 at the properties of the same folder. The actual file size for the same directory is 240 MB.

Why is there a 1 MB difference? Is there a way to have cygwin (which is what I am using) to display the directory file size the same 240 MB?


Putting aside for a moment the fact that this site is for Unix/Linux questions, how do we know that Windows determines size the same way that du does? We can't look at the Windows code since it's proprietary so barring official documentation describing exactly how the calculation is done one shouldn't be surprised by differences. But how hard can it be to count the number of bytes used by some files? Take a look at the answers to this question for some insight into why it is not an exact science: Why are there so many different ways to measure disk usage? (Of course there are no references to Windows but there's still useful information there.)

  • MB vs MiB? Think thats the likely explanation? Ive not done the math tho! – Timothy Frew Mar 19 '18 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.