Deleting an Object
Application Scenario
You can delete unwanted files or folders to save storage space and reduce costs.
If versioning is not enabled for a bucket, deleted objects cannot be recovered. Exercise caution when performing this operation.
Manually or Automatically Deleting Objects
You can manually delete objects any time. Alternatively, you can use lifecycle rules to periodically delete objects from a bucket or clear all objects in a bucket at a time.
Deleting an Object or a Batch of Objects
You can delete one or more objects at a time. For details about how to delete objects in batches, see Does OBS Support Batch Deletion of Objects?
Object Deletion Mechanism When Versioning Is Enabled
When versioning is enabled, OBS uses different deletion methods for different objects.
- Deleting a file or folder does not delete it permanently. The deleted file or folder will be retained in the Deleted Objects list and marked with the Delete Marker.
- If you want to delete the file or folder permanently, you need to delete it from the Deleted Objects list.
- To recover a deleted file, you can cancel the deletion by the Undelete operation. For details, see Undeleting an Object.
- Deleting a version of an object will permanently delete that version. If the deleted version is the latest one, the next latest version becomes the latest version.
- If you delete a version with the Delete Marker, it actually recovers that specific version instead of permanently deleting it. For details, see Undeleting an Object.
- If you delete a version without the Delete Marker, that specific version is deleted permanently. Even if the object is recovered later, this version will not be recovered.
For more information, see Object Recovery Mechanism When Versioning Is Enabled.
How to Use This Function
You can use OBS Console, APIs, SDKs, OBS Browser+, obsutil, or obsfs to delete objects.
| Tool | Reference |
|---|---|
| OBS Console | |
| SDKs | OBS supports software development kits (SDKs) in multiple languages. For details, see the corresponding developer guide on the SDK Overview page. |
| APIs | |
| OBS Browser+ | - |
| obsutil |
Last Article: Direct Reading
Next Article: Undeleting an Object
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.