Is there a way to improve speed on du command on mount point?
I am looking to retrieve occupied space of top level directory of a specified directory in bytes with below command on a mount point & I see its super slow.
du -b --max-depth=1 <mountName>
Whereas df on other hand works super fast to retrieve data of mount point.
Would like to know if there is a way to use du on mount point & get required data in a faster way?
Also is there a way to get sub-directory size ( in bytes ) on top level directory using different command on a mount point?
dutraverses the directory tree, whiledfdoesn't. That is whydfis so much faster, but also only works on whole partitions -- it just reads that partition's metadata. I don't think there is a way arounddubeing slower.