Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
Created July 27, 2023 03:30
Show Gist options
  • Save jdolitsky/8fe4c6b8bd953b43092d6d205a1b1f06 to your computer and use it in GitHub Desktop.
Save jdolitsky/8fe4c6b8bd953b43092d6d205a1b1f06 to your computer and use it in GitHub Desktop.
Top 10 largest files in a container image
top_10_files() { crane export $1 --platform linux/amd64 | tar -tvf - | awk -v size="$size" '$5 >= size {print $5" "$9}' | sort -nrk1.2 | head -n10 | numfmt --to=iec-i --suffix=B --format="%9.2f"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment