Skip to content

Instantly share code, notes, and snippets.

@phosphene
Last active December 14, 2015 03:59
Show Gist options
  • Save phosphene/5024972 to your computer and use it in GitHub Desktop.
Save phosphene/5024972 to your computer and use it in GitHub Desktop.
find and delete large files using find, awk and system rm on ubuntu. ubuntu filename is at $8 on 10.10 but at $9 for 11
find and delete:
find . -type f -size +10000k -exec ls -lh {} \; | awk '{cmd="rm " $9; print cmd; system(cmd) }'
or
just find and print:
find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment