Disk Space Usage – Linux

What’s taking up all the space?

A command prompt try some of the examples I list below:

  1. duhelp

This shows all the parameters you can supply the “du” command with. Typical combinations I use are as follows:

  1. du -h #human readable characters
  2. du -c #grand total displayed at end
  3. du * -s #summarise all folders
  4. du * -sc #summarise and total
  5. du * -scm #summarise, total, Mb
  6. du /home/mydir #show the disk usage of a certain directory
  7. du -ah | sort -n #display
  8. du -sk .[A-z]* *|sort -n #all files and subs within current directory
  9. du /home/mydir -sk .[A-z]* *|sort -n
  10. du * -scm | awk ‘{print $1 "Mb    >>>    " $2}’ | sort -n #sorted and in a Mbytes

You can muck around with displaying it in Megabytes (-m), Bytes (-b), but there are limitations, like files under 1Mb get shown as 1Mb…
Another alternative I came across is:

  1. find . -size +1M
  2. find . -size +10M

If you’re interested in display usage a partition level, try the following commands:

  1. df -h -T
Share and Enjoy:
  • Print
  • email
  • Google Bookmarks
  • Digg
  • Facebook
  • del.icio.us
  • Mixx
  • Live
  • NewsVine
  • Slashdot
  • Technorati
  • Ma.gnolia

Tags: , , ,

Leave a Reply