Skip to content

Instantly share code, notes, and snippets.

@xedef
Last active November 4, 2020 21:03
Show Gist options
  • Save xedef/577137239cc301cbbce15b2313a8b8a3 to your computer and use it in GitHub Desktop.
Save xedef/577137239cc301cbbce15b2313a8b8a3 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"

@alvaropp
Copy link

alvaropp commented Jul 3, 2020

awesome

@mheob
Copy link

mheob commented Aug 21, 2020

Thanks.

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