Home

What Is the gsutil Utility?

|
|  Updated:  
6/19/2018 1:13
|   From The Book:  
TensorFlow For Dummies
Explore Book
Buy On Amazon
The gsutil utility lets you create, access, and modify buckets and objects. For the most part, gsutil commands have the same names and purposes as common <sup>*</sup>nix commands.

This table lists 13 of gsutil's commands. For a more thorough discussion, visit Google's documentation.

gsutil Commands

Command Description
mb [-c class] [-l location]

. [-p proj_id] url…

Make a new bucket
rb [-f] url…
Remove buckets
cp [OPTION]… src_url dst_url

cp [OPTION]… src_url… dst_url

cp [OPTION]… -I dst_url

Copy files and objects
mv [-p] src_url dst_url

mv [-p] src_url… dst_url

mv [-p] -I dst_url

Move objects and/or subdirectories
rm [-f] [-r] url…

rm [-f] [-r] –I

Remove objects
ls [-a] [-b] [-d] [-l] [-L] [-r] [-p proj_id] url…
List buckets and objects
stat url…
Display object status
rewrite -k [-f] [-r] url…

rewrite -k [-f] [-r] –I

Rewrite objects
du url…
Display object size usage
cat [-h] url…
Concatenate object to standard output
compose gs://bucket/obj1

[gs://bucket/obj2 …]

. gs://bucket/composite

Concatenate multiple objects into one
[-D] config [-a] [-b] [-e] [-f] [-n]

. [-o <file>] [-r] [-s <scope] [-w]

Obtain credentials and create a configuration file
web set [-m main_page_suffix]

. [-e error_page] bucket_url…

. web get bucket_url

Associate one or more buckets with a web page

About This Article

This article is from the book: 

About the book author:

Matthew Scarpino has been a programmer and engineer for more than 20 years. He has worked extensively with machine learning applications, especially those involving financial analysis, cognitive modeling, and image recognition. Matthew is a Google Certified Data Engineer and blogs about TensorFlow at tfblog.com.