Having a disk fill up is a real bummer, for a website, everything grinds to a halt and honestly it can be a little scary. So here's a few tips to help find files that are big and growing.
du is pretty awesome at finding the files listing what is big, unfortunately it took me a long time to figure out how to view the folders totals in a directory without showing the files inside of that directory. So the following command roughly means "du" disk usage "-s" summarize add up the contents of the directories "h" show it in human readable format "/usr/"
du -sh /usr/*
Shows:
12K /usr/aquota.user
258M /usr/bin
76K /usr/doc
12K /usr/etc
8.0K /usr/games
27M /usr/include
This that helps gt you in the right direction a good command to move to is something like:
du -k /usr | sort -n | tail -10
which outputs the files in the top ten big files in the /usr directory.
That's a helpful start, perhaps even faster can be done through,
find /usr -size +100k
This helps finds files that are bigger than 100k. Sometimes finding the recent files is also a helpful tool for defining what has been changing lately.
find /usr -mtime -3
Things that I've found that grow to the point of causing me problems on a Red Hat System that I administer.
/var/lib/mysql/ sometimes there are binary log files (bin files) here that grow and grow and grow
/var/log/ can also get a little out of hand, but this can ususally be solved by just manually rotating your log files.
/usr/ can have session files that don't get freed from the disk until the webserver is restarted, very difficult to find.