August 12, 2009

Filter Small Files from the ‘du’ Command with Grep

Ever wanted to filter out the files that were less than 1GB with the simple ‘du’ (disk usage) command? Simple. Add the -h flag and a little grep magic, and you’re all set:

du -h | grep '[0-9]G'