Delete all files in a bucket

  • Nobody/Anonymous

    I'm not sure if I'm missing something or if its really not possible to delete all files in a bucket? Do I really have to delete all files one by one?

    • Michal Ludvig

      Michal Ludvig - 2008-08-24

      Wildcard and recursive removing of files is unfortunately not yet possible. It's planned for 0.9.9 that's due in a few weeks.

      For now there's a (not too intuitive) workaround: create an empty directory on a local filesystem and "s3cmd sync --delete" that directory to the remote bucket. Such a command will remove all files that are not present in the local dir from the remote S3 bucket and since there are no files locally it'll remove all remote objects for you.

      I'll add a nice "s3cmd del --recursive" interface to the next s3cmd release, I'm aware it's much wanted.

    • Nobody/Anonymous

      Fair enough. Thanks Michal.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks