How do I use CLI to delete Object Storage contents?

Linode Staff

When attempting to cancel Object Storage, how do I remove/delete objects, folders, and the buckets themselves using CLI?

1 Reply

In order to fully cancel Object Storage as expected, all contents within your buckets must be fully deleted. Some users delete objects and other components of Object Storage using their Cloud Manager, however, if you are unable to do this, using the CLI commands below may be an alternative method to ensure things are fully removed:

Removes object in folders:
linode-cli obj del $bucket $folder/$object.ext

Removes folders within bucket:
linode-cli obj rb $bucket/$folder

Removes bucket:
linode-cli obj rb $bucket

Because Object Storage is meant to be unstructured data, occasionally those who add folders to their buckets may find they can’t delete them, even if emptied. The second command above helps to both remove these folders. From there, you can delete the bucket, if it doesn’t get removed by the CLI command after a few moments. Hope this helps!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct