Last active
August 29, 2015 14:08
-
-
Save schen1628/e99846797cec7654d67c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script goes through each bucket in s3 and prints out the header for each object. | |
# | |
for bucket in `aws s3 ls | awk '{print $3}'` | |
do | |
for object in `aws s3 ls s3://$bucket --recursive | awk '{print $4}'` | |
do | |
printf "OBJECTS\t$bucket\t$object\t" | |
aws s3api head-object --bucket $bucket --output text --key '$object' | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment