Linux – Total disk space used for one directory including it’s sub-directories

bashfilesystemslinux

On a Linux environment. How can I find out the total space a folder is taking. It would like this total to include ALL sub-directories in the total. I don't want a dump of the size of each subdirectory. Just the total size a directory is taking up with the size of all it's subdirectories included in the c

Best Answer

du -sh /path/to/directory

The output will return sumarize and human readeable directory size.

or in MB

du --max-depth=0 --one-file-system -m /path/to/directory

Also, you can create an alias if you will going to execute this command often.
If you want to know more about du command, execute: man du