Skip to content

Instantly share code, notes, and snippets.

@ryanmaclean
Created October 26, 2016 23:07
Show Gist options
  • Save ryanmaclean/7d77421196da4707e4bba984e9996173 to your computer and use it in GitHub Desktop.
Save ryanmaclean/7d77421196da4707e4bba984e9996173 to your computer and use it in GitHub Desktop.
Gzip 10 Largest Files
#!/usr/bin/env bash
# Find the 10 largest files in a directory and transparently zip them
for i in $(du -hsx * | sort -rh | head -10 | awk '{print $2}'); do gzip $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment