What Is the gsutil Utility?

By Matthew Scarpino

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 *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