Last active
April 21, 2021 21:57
-
-
Save nickperkins/075cf7797672b1ecbb101470f56e8a24 to your computer and use it in GitHub Desktop.
Delete empty files from s3
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
aws s3api list-objects --bucket my-bucket-name --output json --query 'Contents[?Size==`0`]' | jq -r '.[] | [.Key] | @tsv' | xargs -n 1 sh -c 'aws s3 rm s3://my-bucket-name/$@' bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment