Skip to content

Instantly share code, notes, and snippets.

@verschuur
Forked from xedef/remove-indexing-files.md
Created September 9, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verschuur/a5af0e1b487d5838dba9e1f4209b361d to your computer and use it in GitHub Desktop.
Save verschuur/a5af0e1b487d5838dba9e1f4209b361d to your computer and use it in GitHub Desktop.
Remove all .DS_Store files (or any unwanted indexing file) from a S3 bucket, recursively

You can replace "*.DS_Store" with any other recurrent file (e.g. Desktop.ini)

Please!

Validate that you are going to delete only what you want passing the --dryrun option. I've left if by default just in case of copy/paste.

aws s3 rm s3://your.bucket.name/maybe-a-subkey --dryrun --recursive --exclude "*" --include "*.DS_Store"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment