I have my server on Mediatemple and i reached my 20GB quota. I installed Ubuntu and many plugins but I don't know how I reached that 20GB? I'm running a website but I'm sure it is not taking all that space!
3 Answers
sudo du -x / | sort -n
will at least show you what's using space. As to whether it's legitimately using space or not is up to you to decide.

- 5,225
- 1
- 28
- 39
-
Oh that's much simpler than my method =) – May 16 '11 at 02:10
-
wow...i foudn out that all my space about 19gb is taken by logs files!!! apache/error.log is 17gb!!! should i delete them?? is it possible to set a purge weekly? – Francesco May 16 '11 at 02:17
-
1@camelCase, if you have that large of a error log file, maybe you want to investigate *why* you have so many errors, instead of just wiping it out... – Holocryptic May 16 '11 at 03:13
-
2@Holocryptic is correct, but once you have done that you really need to enable logrotate so that you don't have this happen again. It compresses older logs for space and can throw away logs after a window. – n8whnp May 16 '11 at 09:27
Shell in, cd to / and run
du -d 1 -h ./
(That will give you the total size of each directory).
CD to the largest directory and run the command again, rinse and repeat till you find all the big files =)
Edit:
The process might not have been 100% clear, when you run DU it'll give you a list of folders and their sizes like
2GB /foldera
1GB /folderb
[etc]
So in that case, CD into foldera and run the du command again, that'll give you the list of largest files/folders in there, keep drilling down till you find the largest files. If you don't need them, remove them.
If you have ssh-access and a linux box, you can easily graph your disk with baobab. This tool can also read remote folders via ssh and makes a circle diagram.
Also on my box du
has no -d
option and I use sudo du -h --max-depth=1 /
get an overview on command line.

- 1,188
- 9
- 11
-
Are you sure your version of `du` doesn't support depth limiting (the `-d` option)?? I've never seen one that doesn't before; what OS are you running? – Chris S May 18 '11 at 03:33