View Single Post
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#8
Originally Posted by j.s View Post
Then why does du take longer to run, and why is df almost instantaneous? I was not making things up with my answer.
du takes longer to run as it needs to look at every single file to get the details, whereas df only needs to look at the filesystem metadata (see "tune2fs -l" for example). du should report the actual space used (unless run with the --apparent-size flag), taking into account the filesystem block size.