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)



stat - Display object status

stat - Display object status

Synopsis

gsutil stat url...

Description

The stat command will output details about the specified object URLs. It is similar to running:

gsutil ls -L gs://some-bucket/some-object

but is more efficient because it avoids performing bucket listings gets the minimum necessary amount of object metadata.

The gsutil stat command will, however, perform bucket listings if you specify URLs using wildcards.

If run with the gsutil -q option nothing will be printed, e.g.:

gsutil -q stat gs://some-bucket/some-object

This can be useful for writing scripts, because the exit status will be 0 for an existing object and 1 for a non-existent object.

Note: Unlike the gsutil ls command, the stat command does not support operations on sub-directories. For example, if you run the command:

gsutil -q stat gs://some-bucket/some-object/

gsutil will look up information about the object “some-object/” (with a trailing slash) inside bucket “some-bucket”, as opposed to operating on objects nested under gs://some-bucket/some-object. Unless you actually have an object with that name, the operation will fail.

Authentication required

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

Signing you in...

Google Developers needs your permission to do that.