Deleting underscored filenames from a bucket

Monday, Dec 15, 2014

Using the AWS cli and a fairly straightforward shell:

aws s3 ls --recursive s3://BUCKET | grep -F "._" | awk '{print $4}' | while read delme; do echo aws s3 rm s3://BUCKET/$delme; done