disk

How to Check Disk Space and Directory Space in Linux

Submitted by kai on Thu, 2009-03-26 10:21. ::

Surprisingly, I often run into the problem of running out of disk space in Linux.

Here are some simple commands to check what consumes the most space:

  • "df -k" shows the percentage of disk consumption for each partition
  • "du --max-depth 1 -h /" shows how much space each directory under "/" consumes in megabytes
  • "du -sm * | sort -n" does the same thing as the previous command

stackoverflow has a good discussion as well.

XML feed