Skip to content

Instantly share code, notes, and snippets.

@DinosaurDad
Created January 15, 2018 20:57
Show Gist options
  • Save DinosaurDad/16ac73d1dc5e317638007ce82719aad4 to your computer and use it in GitHub Desktop.
Save DinosaurDad/16ac73d1dc5e317638007ce82719aad4 to your computer and use it in GitHub Desktop.
AWS - S3 - Delete files with extension
aws s3 rm s3://somebucket/somefolder/ --recursive --dryrun --exclude "*" --include "*.json"
@wadebarrie
Copy link

Could you explain the --exclude "*" ? And I can assume that --include "*.json removes all .json files from somefolder?

@melino
Copy link

melino commented Aug 9, 2023

First exclude all: --exclude ""
Then include only .json: --include "
.json"

Could you explain the --exclude "*" ? And I can assume that --include "*.json removes all .json files from somefolder?

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