phocks
phocks

Reputation: 3273

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

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.

Upvotes: 29

Views: 18261

Answers (1)

hek2mgl
hek2mgl

Reputation: 157967

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 .. )

Upvotes: 52

Related Questions