Linux: How to find a directory size?


Using Red Hat Enterprise Linux 5.x (“RHEL”) and / or CentOS 5.x, I wanted to know the size of the existing folder. There is a utility that will summarize disk usage for each file, recursively for directories. It is called du. As it turns out, this utility is also applicable for other distributions of Linux including Ubuntu. This command line utility with the following command parameters are useful for the desired result.

 du -h | grep -v '/' | awk '{print $1}' 
 du -h | tail -n 1 
 du -ch | grep total