How to delete folder from an S3 bucket

Use the below command to delete folder named ‘prefix’ and all it’s contents from an S3 bucket

aws s3 rm s3://bucketname/prefix --recursive

See also  How to enable ENA on an EC2 Instance