« Parking Stub | Main | Stderr .... output to grep »

Disk Hog on Unix

So it often comes to the time to find what is taking all the space on your hard drive and like many things in unix, this isnt so straight forward, du (disk usage) will tell you how to do this, here will show you your top ten offending directories:

du -ha / | sort -n -r | head -n 10

du -ha = disk usage in human readable format ( lowest to highest )
sort -n -r = reverse the order
head -n 10 = top ten

| = pipe the output to the next command

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)