Skip to content

Instantly share code, notes, and snippets.

@jiminald
Created October 23, 2022 20:52
Show Gist options
  • Select an option

  • Save jiminald/38d83ab3e10377bed45069abea1b62d0 to your computer and use it in GitHub Desktop.

Select an option

Save jiminald/38d83ab3e10377bed45069abea1b62d0 to your computer and use it in GitHub Desktop.
S3 JSON to CSV
aws s3api list-objects --bucket [BUCKET NAME] --output json --query 'Contents[].{Key: Key, Size: Size}' > objects_with_size.json
cat objects_with_size.json | jq -r '.[] | [.Key,.Size] | @csv' > objects_with_size.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment