jan 242013

findHere’s a simple script I’m using to locate big directories (larger than 1GB):

du -h | grep "^ *[0-9][0-9.]*G"

The output looks like this:

1.1G ./Art/2007
2.5G ./Art/2008/Party Freakz Pasta Party
6.3G ./Art/2008
9.2G ./Art
24G ./Documents/Parallels/Windows 7.pvm/Windows 7-0.hdd
24G ./Documents/Parallels/Windows 7.pvm
24G ./Documents/Parallels
26G ./Documents
2.5G ./Downloads/enstrophy-big-endian
33G ./Downloads
100G .

Here’s how I find big directories greater than 100MB:

du -h | egrep "^ *([0-9][0-9][0-9][0-9.]*M)|([0-9][0-9.]*G)"

To list files, too, just add the -a flag to du like this:

du -ah | grep "^ *[0-9][0-9.]*G"

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>