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 call a function in Redshift database