gdcloud storage rm

名称

gdcloud storage rm - 删除对象和存储分区。

摘要

gdcloud storage rm [URLS ...]
    [--all-versions, -a]
    [--continue-on-error]
    [--recursive, -r]
    [--format=FORMAT]
    [--log-http]
    [--verbosity=VERBOSITY] [flags]

示例

The following command deletes an object named my-object from
the bucket my-bucket:

    gdcloud storage rm s3://my-bucket/my-object

The following command deletes all objects directly within the directory
my-dir, but no objects within subdirectories:

    gdcloud storage rm s3://my-bucket/my-dir/*

The following command deletes all objects and subdirectories within the
directory my-dir:

    gdcloud storage rm s3://my-bucket/my-dir/**

Note that for buckets that contain versioned objects, the previous
command only affects live versions. Use the --recursive flag instead to
delete all versions.

The following command deletes all versions of all resources in my-bucket
and then deletes the bucket.

    gdcloud storage rm --recursive s3://my-bucket/

The following command deletes all text files in the top-level of my-bucket,
but not text files in subdirectories:

    gdcloud storage rm -recursive s3://my-bucket/*.txt

可选标志

  -a, --all-versions        Delete all versions of an object.
  -c, --continue-on-error   If any operations are unsuccessful, the command will exit with a non-zero
                            exit status after completing the remaining operations. This flag takes
                            effect only in sequential execution mode (i.e. processor and thread count
                            are set to 1). Parallelism is default.
      --log-http            Log all HTTP server requests and responses to stderr.
  -r, --recursive           Recursively delete the contents of buckets or directories that match
                            the path expression. If the path is set to a bucket, the bucket is also
                            deleted. This option implies the --all-versions option. If you want to
                            delete only live object versions, use the ** wildcard instead.
      --verbosity string    Override the default verbosity for this command. VERBOSITY must be one of:
                            debug, info, warning, error, critical, none. (default "warning")

GDCLOUD 全局标志

以下标志适用于所有命令:--configuration--format--help--project--quiet

如需了解详情,请参阅 gdcloud CLI 参考概览页面。