Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
Created January 16, 2013 22:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save fernandoaleman/4551494 to your computer and use it in GitHub Desktop.
Save fernandoaleman/4551494 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