Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



cat - Concatenate object content to stdout

cat - Concatenate object content to stdout

Synopsis

gsutil cat [-h] url...

Description

The cat command outputs the contents of one or more URLs to stdout. It is equivalent to doing:

gsutil cp url... -

(The final ‘-‘ causes gsutil to stream the output to stdout.)

Options

-h

Prints short header for each object. For example:

gsutil cat -h gs://bucket/meeting_notes/2012_Feb/*.txt

This would print a header with the object name before the contents of each text object that matched the wildcard.

-r range

Causes gsutil to output just the specified byte range of the object. Ranges are can be of these forms:

start-end (e.g., -r 256-5939)
start-    (e.g., -r 256-)
-numbytes (e.g., -r -5)

where offsets start at 0, start-end means to return bytes start through end (inclusive), start- means to return bytes start through the end of the object, and -numbytes means to return the last numbytes of the object. For example:

gsutil cat -r 256-939 gs://bucket/object

returns bytes 256 through 939, while:

gsutil cat -r -5 gs://bucket/object

returns the final 5 bytes of the object.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.