Skip to main content

awk oneliner to find large files

A mega geeky awk one-liner today. Tested on Solaris under bash, so [YMMV][1].

Have you ever found that a filesystem is filling up fast, and dont know what is causing it? This one liner (which can be placed in a cron job if you like) is best run as a super user.

It will:

  1. Search for all files in the current dir and subdirs that are modified in the last 3 days;
  2. list them, filtering just the filesize and name/path;
  3. sort/order by the largest file; and
  4. Email you a copy of the report.