rm

Prev Next

Available in Classic and VPC

Delete an object stored in Ncloud Storage.

Commands

The command statement is as follows:

aws s3 rm <target> --endpoint-url <value> [--options] 

Parameter

The following describes the parameters.

Parameter Type Required Description Restrictions
--endpoint-url <value> string Y Specify the default URL for command calls. It is only available for the KR Region. See Ncloud Storage overview for call domain information.
--dryrun boolean N Only check the results of the action, but do not actually apply them. -
--quiet boolean N Response results not displayed -
--recursive boolean N Apply command scope to subdirectories. -
--include <value> string N Set the rule to include only specified objects in commands and apply them in the specified order. -
--exclude <value> string N Set the rule to exclude specified objects from commands and apply them in the specified order. -
--only-show-errors boolean N Only errors are displayed; other response values are not displayed. -
--page-size <value> integer N Specify the number of listings for each response. Up to 1000 supported
--debug boolean N Use debug logging. -
--no-verify-ssl boolean N Redefine the default behavior for validating SSL certificates. -
--no-paginate boolean N Disable automatic pagination, call only the first page for results. -
--output <value> string N Specify the format of call results. Available options
- json
- text
- table
- yaml
- yaml-stream
--query <value> string N JMESPath query to use for filtering response data -
--profile <value> string N Use a specific profile in the credentials file. -
--region <value> string N Specify the Region. Only KR is supported.
--color <value> string N Set output color. Available options
- on
- off
- auto
--no-sign-request boolean N Disable credential loading. -
--ca-bundle <value> string N Specify the CA certificate to use when verifying SSL certificates. -
--cli-read-timeout <value> int N Maximum read time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--cli-connect-timeout <value> int N Maximum connection time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--no-cli-pager boolean N Disable the CLI pager for response values. -
--cli-auto-prompt boolean N Enable automatic prompting for CLI input parameters. -
--no-cli-auto-prompt boolean N Disable automatic prompting for CLI input parameters. -

Examples

This section describes an example of calling and responding to the rm command.

Delete object.

Call examples

Specify the path of the object to be deleted and call the command to delete the object. The following is a call example.

aws s3 rm s3://bucket-aa/image.png --endpoint-url=http://kr.ncloudstorage.com

Response example

The response example is as follows:

delete: s3://bucket-aa/image.png

Delete all objects in bucket except those with ".jpg" extension

Call examples

By using the --recursive option and the --exclude and --include options, you can delete or not delete only objects that meet specific conditions when calling the command. The following is a call example.

aws s3 rm s3://bucket-aa/ --endpoint-url=http://kr.ncloudstorage.com --recursive --exclude "*.jpg"

Response example

The response example is as follows:

delete: s3://bucket-log/test123/
delete: s3://bucket-log/test123/241202120123.txt
delete: s3://bucket-log/241203120012.txt