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

or

du

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

du

 

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

http://unixhelp.ed.ac.uk/CGI/man-cgi?du

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

Cheers

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Leave a Reply