In general, du
gives you the amount of storage the data is occupying on the disk while a lot of other ways to measure the data will give you the size of the data.
Why is this not the same?
- Sometimes data can be stored very efficiently and needs less space on storage than its original size. This can happen if you have got sparse files or hard links. While these two are common on Unix*ish file systems there might be other things, depending on the weirdness of your file systems.
- Sometimes data needs more space on disk than it has originally in size. This is rather normal due to the fact that all file systems order their file data in blocks and data doesn't always come in multiples of the block size. This means that some part of the last block is typically wasted (i. e. occupied but not used).