Mittwoch, 9. Juli 2008

Find files using disk space under Linux ...

Even with the largest harddrives at some point they run out of memory. Now you would like to find out where all the space is used. Under Linux you do it like this:

  1. Finding folders using a lot of disk space:
    user:/ # du -hs *

    This will give you a summary of the folders under root dir ('/') and their memory usage.
  2. Find files above a specific size
    Now let's assume that you found the folder using up the most disk space. Which files are cousing this? Well simply try to find the files that are e.g. larger than 30MByte:
    user:/ # find -type f -size +30M

    This will give you a list of all files larger than 30MByte. 

With the above information you should be able to locate the candiates using up the space of your harddisk.