From 4a23a33e4099212ad1227b49e824d0bae6663a7b Mon Sep 17 00:00:00 2001 From: Dina Basumatary Date: Sun, 25 Sep 2022 14:18:06 +1000 Subject: [PATCH] gsutil: add page (#7961) * gsutil: add page * Update pages/common/gsutil.md use lower snake case Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: Emily Grace Seville * Update pages/common/gsutil.md Co-authored-by: pixel * Update pages/common/gsutil.md Co-authored-by: pixel Co-authored-by: Emily Grace Seville Co-authored-by: pixel --- pages/common/gsutil.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pages/common/gsutil.md diff --git a/pages/common/gsutil.md b/pages/common/gsutil.md new file mode 100644 index 0000000000..dbe4187562 --- /dev/null +++ b/pages/common/gsutil.md @@ -0,0 +1,33 @@ +# gsutil + +> The gsutil CLI lets you access Google Cloud Storage from the command line. +> You can use gsutil to do a wide range of bucket and object management tasks. +> More information: . + +- List all buckets in a project you are logged into: + +`gsutil ls` + +- List the objects in a bucket: + +`gsutil ls -r 'gs://{{bucket_name}}/{{prefix}}**'` + +- Download an object from a bucket: + +`gsutil cp gs://{{bucket_name}}/{{object_name}} {{path/to/save_location}}` + +- Upload an object to a bucket: + +`gsutil cp {{object_location}} gs://{{destination_bucket_name}}/` + +- Rename or move objects in a bucket: + +`gsutil mv gs://{{bucket_name}}/{{old_object_name}} gs://{{bucket_name}}/{{new_object_name}}` + +- Create a new bucket in the project you are logged into: + +`gsutil mb gs://{{bucket_name}}` + +- Delete a bucket and remove all the objects in it: + +`gsutil rm -r gs://{{bucket_name}}`