How do I use CLI to delete Object Storage contents?
When attempting to cancel Object Storage, how do I remove/delete objects, folders, and the buckets themselves using CLI?
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!