Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 313
phocks Avatar asked Dec 18 '14 12:12

phocks


1 Answers

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

like image 60
hek2mgl Avatar answered Sep 21 '22 02:09

hek2mgl