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
INDICATEURS FACULTATIFS
-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")
OPTIONS GCLOUD GÉNÉRALES
Ces options sont disponibles pour toutes les commandes : --configuration, --format, --help, --project, --quiet.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003e\u003ccode\u003egdcloud storage rm\u003c/code\u003e is used to delete objects and buckets within cloud storage.\u003c/p\u003e\n"],["\u003cp\u003eThe command can target specific objects, all objects within a directory, or entire buckets using different path expressions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--recursive\u003c/code\u003e flag allows for the deletion of all content within a directory, including subdirectories, and can be used to delete entire buckets.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--all-versions\u003c/code\u003e flag is used to delete all versions of an object, while by default only live versions are deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e-c\u003c/code\u003e flag will exit the command with an error status after completing all operations if any fails, and this only works when parallelism is set to 1.\u003c/p\u003e\n"]]],[],null,["# gdcloud storage rm\n\nNAME\n----\n\ngdcloud storage rm - Delete objects and buckets.\n\nSYNOPSIS\n--------\n\n gdcloud storage rm [URLS ...]\n [--all-versions, -a]\n [--continue-on-error]\n [--recursive, -r]\n [--format=FORMAT]\n [--log-http]\n [--verbosity=VERBOSITY] [flags]\n\n### EXAMPLES\n\n The following command deletes an object named my-object from\n the bucket my-bucket:\n\n gdcloud storage rm s3://my-bucket/my-object\n\n The following command deletes all objects directly within the directory\n my-dir, but no objects within subdirectories:\n\n gdcloud storage rm s3://my-bucket/my-dir/*\n\n The following command deletes all objects and subdirectories within the\n directory my-dir:\n\n gdcloud storage rm s3://my-bucket/my-dir/**\n\n Note that for buckets that contain versioned objects, the previous\n command only affects live versions. Use the --recursive flag instead to\n delete all versions.\n\n The following command deletes all versions of all resources in my-bucket\n and then deletes the bucket.\n\n gdcloud storage rm --recursive s3://my-bucket/\n\n The following command deletes all text files in the top-level of my-bucket,\n but not text files in subdirectories:\n\n gdcloud storage rm -recursive s3://my-bucket/*.txt\n\n### OPTIONAL FLAGS\n\n -a, --all-versions Delete all versions of an object.\n -c, --continue-on-error If any operations are unsuccessful, the command will exit with a non-zero\n exit status after completing the remaining operations. This flag takes\n effect only in sequential execution mode (i.e. processor and thread count\n are set to 1). Parallelism is default.\n --log-http Log all HTTP server requests and responses to stderr.\n -r, --recursive Recursively delete the contents of buckets or directories that match\n the path expression. If the path is set to a bucket, the bucket is also\n deleted. This option implies the --all-versions option. If you want to\n delete only live object versions, use the ** wildcard instead.\n --verbosity string Override the default verbosity for this command. VERBOSITY must be one of:\n debug, info, warning, error, critical, none. (default \"warning\")\n\n### GDCLOUD WIDE FLAGS\n\nThese flags are available to all commands: `--configuration`, `--format`, `--help`, `--project`, `--quiet`.\n\nFor more information, see the [gdcloud CLI reference overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud) page."]]