Show Disk Space Usage (Sorted)

Every once and awhile I find myself needed to what is the space hog on my computer/server. While the command du – h in the command line works for a general overview – I really want to see the results in descending order (by space used). This command will list out everything in descending order so you can quickly see where the most space is used:

du -k -s * | sort -k1 -g -r

Out of Disk Space

If you all the sudden get database errors (select, cannot login, cannot write, etc) – and everything looks ok (from the database end of things) check to make sure you have not run out of disk space. How do I know? Well – let’s say last night I had to do a major fall clean-up. If you know me and my monitoring habits, this will sound a bit confusing because one of the many things I monitor is disk space, but when your hosting company accidentally halves your disk space – trouble can occur, and quickly. I have not had many issues at all with Liquid Web – but this was major…and handled a little slower than I would have liked.