IamCalvinBrown.com a Blog Site

Code Examples, Consulting Advice and lots of other cool things

AWS CLI - Delete all files matching a filter in an S3 bucket

Amazon AWS can be amazing and interesting to deal with at times. When you host a static website using S3 and Route 53, it sometimes creates files for each request the service receives. To purge these files and avoid having tens of thousands or even millions of useless files, use this command on your local CLI:

#Delete all files that name start with "2018" files from the bucket:

aws s3 rm s3://[your-aws-bucket-name]/ --recursive --exclude '*' --include '2018*'

Comments (2) -

  • prashanth

    3/14/2019 11:52:25 AM |


    useful information.
    thanks for posting .
    keep sharing.
    <a href="https://bit.ly/2IG5YWf";>best aws cloud training in Bengaluru</a>

  • Bm5y

    10/21/2019 8:46:55 AM |

    643206 959189Fascinating blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog shine. Please let me know where you got your design. Thanks a lot 846113

Loading