I ran out of disk space on an ubuntu server. How can I know how the disk space is being used so I can clean up the disk / delete unnecessary files?

link|improve this question
feedback

5 Answers

  • df -h: will tell you space usage of all mounted filesystems.
  • du -sh: will tell you space usage of current directory.
  • du -h --max-depth=1: will tell you space usage of each directory in current directory.
link|improve this answer
2  
I like du -sh ./* to list the sizes of all the folders in the current directory. – wag2639 Jun 17 '10 at 1:29
I prefer: df -PkH – djangofan Aug 16 '11 at 23:39
feedback

Try NCurses Disk Usage. It is pretty darn usable as an end-user tool (as opposed to something a programmer might use in a script).

link|improve this answer
feedback

Listing files/folders by size in descending order;

du -sk * |sort -rn

In human readable sizes (GNU sort only);

du -sh * |sort -rh
link|improve this answer
answer could definitely use some explanation, it lists the files/folders by size in descending order, which I have to say is quite useful when trying to figure out what is hogging disk space. Doesn't list sizes in human readable form but still +1 – radman Jun 17 '10 at 2:21
Updated original answer with suggestions from @radman – realist Apr 17 at 3:38
feedback

du is the command for the job as it will give you the disk usage.

Try to run du -sh at your root directory and then on the directories below.

Hope this helps.

link|improve this answer
feedback

a graphical program that I like is KDirStat. Someone else mentioned ncdu and it's nice. KDirStat gives you one huge overview of your entire drive.

KDirStat Homepage

link|improve this answer
feedback

Your Answer

 
or
required, but never shown