On a Unix or Linux server, the “du” command provides a quick and easy method for finding out how much space each directory is using, as well as a summary of total disk usage. For example, if you just typed “du” from the command line, the output might look like this:
This shows you disk usage for directories, but it shows output in bytes. If you want a simplified output (i.e. 1M, 2G), use the “-h” option. Type “du -h” and the output will look like this:
As you can see, they display simplified output, but it is not sorted. If you want to sort it by size, you will have to get a little more creative. The following command will display a simplified output sorted by size:
du -hs * | sort -h
As you can see, du is a versatile tool that you can use to find out just how much disk space you are using overall even more specific details about individual directories and their disk usage.