Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drewmace/ac44a8aa4e92083819413b9abbe51a3f to your computer and use it in GitHub Desktop.
Save drewmace/ac44a8aa4e92083819413b9abbe51a3f 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