Is the licenses directory not 800KiB?
Of course not - check out the contents.
... do you suspect that the missing 4K is the space used by the directory itself?
(rt-click on licences and select "properties" and I see it listed as 779.2K ... remeber, there is rounding to consider with du.)
But you were comparing du with ls
simon@errata:~/projects/tutorial$ ls -l licenses
Yea, thanks for your help. So there is no standard way to figure this out?
I think the thing to ask here is "what are you trying to achieve?"
Presumably you could write a script to get the size of regular files only out of an ls output and then add them, but why would you want to?
du will tell you how much disk space a given directory occupies if you have restricted space in your account, and ls will tell you how big the files are if you want to move them to another media and you want to know if they will fit.