Linux How to get total directory size

Hi Guys,

Just a quick one here, If you want to know size of a directory/folder you can use du command which is short form to disk usage

You can cd to that directory and run this command

Forget about the fact that I am logged in as root, I was just doing some weird things.

Option 1

Option 2



Now the above commands will print fill directory size but just in case you want to list sub directory size separately then this is how you do it



You can also specify directory path as shown below

Above will work on /home/web folder

You can also get quite interesting but if all depends what you are trying to do

just type

to see what else you can do

here is a quick link to man page available through

Above listed is just to give you an indicator Linux is so wide with its commands that there could be another 10s of combination to achieve above results but I am not not aware of those 10s so I rely on the above mentioned commands 🙂

I hope this helps

Just in case you would like to add something to this post or want to correct improper use of a command please leave your comments


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.