du
gives disk usage, which is not the same as the sum of all the file sizes.
For example, a du -b file
will give a different output than making a directory "dir", placing the same file in "dir" and doing du -b dir
. On my system that's 30 extra bytes for the "overhead" of a directory. Depending on the contents of the directory, I imagine the directory size would change (but I would be surprised if it was perfectly linear).
Also, the relative size of the difference implies that you might have missed a hidden directory with quite a few files in it, or that you might have missed a lot of hidden files (even though you did use the -a flag).
In addition, there may be symlinks which cause differences if one tool follows them while the other doesn't.
Finally, with some file systems, if the file's contents are small enough they might get inlined into the file system INode, and with many file systems, a single block is reserved to hold the contents of the file even if that block is not fully used. These variations add extra noise when attempting to compare the two.