Created
June 19, 2020 12:40
-
-
Save bepcyc/b6727c5a2c90899815f076495946ee32 to your computer and use it in GitHub Desktop.
S3 buckets file count
This file contains 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
FILENAME=/tmp/buckets | |
for b in $(aws s3api list-buckets | jq -r ".Buckets[].Name"); do aws s3api list-objects --bucket $b --output json --query "[length(Contents[])]" | jq -c ".[0]" | xargs -I {} echo -e {}"\t$b" >>$FILENAME ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment