title: How to empty S3 bucket using AWS CLI
body: <p>I'm trying to empty an S3 bucket using CLI.</p>
  <ol>
  <li><p>I tried <code>aws s3 rm --recursive</code> command which doesn't empty my bucket as it has versioned enabled.</p>
  </li>
  <li><p>I tried <code>aws s3 rb --force</code> command to forcefully delete the bucket, which doesn't work as well. It throws this error <code>BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket.</code></p>
  </li>
  </ol>
  <p>I really need to get this done using CLI. Is there a way to do it. Please help. The end goal is to delete the bucket. Thanks in advance.</p>