9

s3cmd s3://MYBUCKET/FOLDER does not work. (folder is empty)
s3cmd s3://MYBUCKET/FILE does not work.

Output of both commands is "File FILE sucessfully deleted", yet the file remains on the bucket.

Deleting with the S3 Webinterface works just fine.

3 Answers 3

12

It looks like you have the syntax wrong (although it's possible you just typed it into this thing wrong).

From the S3 Tools documentation it looks like you want something like this:

s3cmd del s3://BUCKET/OBJECT

and

s3cmd del -r s3://BUCKET/FOLDER

Typically you need to use the -r, or recursive, flag to delete folders.

If that doesn't work, check that your permissions and keys are correct.

0

This is what worked for me.

> s3cmd  ls s3://BucketName/foldername_prefix* |awk '{print $2}' | while read files; do s3cmd  rm -r $files; done
0

In some cases (like using hudi format) even delete command like this does not work:

s3cmd rm s3://mybucket/myfileidontwant --force

Then the only solution is to create the file manually using s3cmd, and then run delete command.

You must log in to answer this question.