How can I make the "du" command run without outputting all the directories, like quiet mode?

14.9k views Asked by At

I am trying to get the size of a directory in Linux but it has a lot of subdirectories and seems to take forever to go through all of these files and directories before giving me an answer to what size it is. I've searched the help and manual entry and online, but can't find anything. Does it really have to output every directory as it is scanning? Is there a way to speed up this process? Usually with other commands you can just use the "-q" quiet mode switch.

1

There are 1 answers

1
hek2mgl On BEST ANSWER

Use the option -s (summarize):

du -sh folder

(-h is used to make the output human readable, meaning converting the number of bytes into KB,MB,GB .. )