Often while I’m administrating a Linux/Unix box I come across the tediousus task of freeing up space on the server, usually this task is easily accomplished by issuing a simple “ls -lh” command, you get a nice listing of the files in the current directly along with some nifty details like last modification date and size (the -h parameter for ls allows us to get the size in a human-readable way).
The downsize of doing it this way is that you don’t get to know for real the size of the folders within the current directy, you get a nice total on top of the “ls” listing. A nice command to get the size of a certain folder is issuing a ds
du -sh folder/
This way you’ll get the following result:
pepper:~ pepper$ du -sh perrohunter.com/
You can see that the folder perrohunter.com weights a total of 694 MB. (yeah, that much).
But what if you’d like to know the size of all the folders within the current folder? Piece of cake, just use the * wildcard and that’d do the trick:
du -sh *
And you should get a result similar to the following:
pepper:~ pepper$ du -sh *
You can see the folders now have the total size of them in MB. Hope this is helpful for you.
perrohunter.com has potential, you can make your
blog go viral easily using one tricky method. Just search in google:
Kimting’s Method To Go Viral
Last one to utzilie this is a rotten egg!
Hello admin, i must say you have very interesting content
here. Your blog should go viral. You need initial traffic boost only.
How to get it? Search for; Mertiso’s tips go viral
du – sh ./* gives the size of all directories but sorts it by name..
How can I sort the directory size output by created/mod date of the directory