I am trying to find the best way to get the space used by all files in a directory and it's subdirectories. There are many posts about this like this one : Calculating a directory's size using Python?
However the recursive file counting methods and the linux du -sh command recommended in that thread give widely different results. On the same directory with only two files if I count the file sizes alone with any method I get: 864 Bytes
With the linux du -hs command i get 12K bytes!
That is a huge difference anyone knows why?