Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nixjobin/5fb540afe744437c4af589fd8cd194e8 to your computer and use it in GitHub Desktop.
Save nixjobin/5fb540afe744437c4af589fd8cd194e8 to your computer and use it in GitHub Desktop.
How to recursively delete Amazon S3 zero byte files from buckets
s3cmd ls --recursive s3://BUCKET_NAME | ruby -rdate -ne 'date, time, size, uri = $_.split; puts uri if size == "0"' | xargs s3cmd del
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment