Created
April 18, 2018 07:19
-
-
Save arc279/945057b74c56bafbb4923a64fffff472 to your computer and use it in GitHub Desktop.
s3のファイルをまとめて消すコマンドを出力
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment