delete-object
The delete-object command is used to delete objects in OSS buckets.
Usage notes
-
By default, an Alibaba Cloud account has the permissions to delete files. Deleting files as a RAM user or by using Security Token Service (STS) requires
oss:DeleteObjectpermission. For more information, see Grant a custom policy. -
If the object you want to delete is a symbolic link, the DeleteObject operation deletes only the symbolic link but not the content to which the link points.
Command syntax
ossutil api delete-object --bucket value --key value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
Name of the bucket. |
|
--key |
string |
Full path of the object. |
|
--version-id |
string |
Version ID of the object. |
-
The delete-object command corresponds to the DeleteObject operation. For more information about the parameters in the DeleteObject operation, see DeleteObject.
-
For more information about supported global command-line options, see Command-line options.
Examples
-
Delete the
exampleobjectobject.ossutil api delete-object --bucket examplebucket --key exampleobject -
Delete the
exampleobjectobject whose version ID is 123.ossutil api delete-object --bucket examplebucket --key exampleobject --version-id 123