Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BUCKET_NAME=some_bucket
- PATTERN='some_pattern'
- aws s3 ls --recursive s3://${BUCKET_NAME} | rev | cut -f1 -d' ' | rev > file_lst
- cat file_lst | grep -oP "$PATTERN" | xargs -I{} echo "aws s3 rm --recursive 's3://${BUCKET_NAME}/{}'" > rm_cmd.sh
Add Comment
Please, Sign In to add comment