Skip to content

Instantly share code, notes, and snippets.

@sandys
Created August 8, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandys/76654d6271db0ece3c38 to your computer and use it in GitHub Desktop.
Save sandys/76654d6271db0ece3c38 to your computer and use it in GitHub Desktop.
get size and count of a s3 bucket in human readable form
aws s3api --profile redcarpetup_media list-objects --bucket media.chefatlarge.in --output json --query "[sum(Contents[].Size), length(Contents[])]" | awk 'NR!=2 {print $0;next} NR==2 {print $0/1024/1024/1024" GB"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment