Linux Disk Usage

Every now and then one of my servers will stop working because the hard drive or one of its partitions has filled up.  In almost every case it has simply been choking on a log file that grew to massive proportions, but not always.

There are a lot of linux commands that will help you track down what’s using up all your memory.  However I found that they often left me just as puzzled afterwards.  Here’s a handy one that will show you the space being used by every folder or file in the current directory and most importantly they will be sorted by size.

du -sk * | sort -n

Tags: , ,

  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

One Response to “Linux Disk Usage”

  1. Alex says:

    Much better:
    du -dh | sort -n
    Eliminates numbering the kilos and jokes like: Regular people believe that the kilobyte has 1000 bytes, the programmer KNOWS that the kilometer has 1024 meters.

Leave a Reply