I've got a web host (linux hosting) whose disk is almost completely full. How do I list out directories (and their subdirectories) by largest size to figure out where the biggest disk hogs are?
migrated from webmasters.stackexchange.com Mar 8 '12 at 12:41
This question came from our site for pro webmasters.
From a terminal:
Show disk free space (human readable)
Show sizes in the www-root
Apache log files
These would be my first few guesses (databases as well). Also, your applications may have log files as well, so keep that in mind. ie:
Hope this helps!
A command line I've found very useful in finding out what's filling my disk is
This will list all the files and directories under the current directory in decreasing order of total disk space usage. The numbers before each line are in kilobytes.
For example, running this command in
From this output, I can notice for example that I have a lot of LaTeX documentation installed that I'm not really using. If I needed to free some disk space, that would seem like a good place to start.
Mind you, running this command can take a while if you have a lot of files. If you might want to keep the list around for a while, it may be a good idea to redirect it to a file instead of piping it directly to