cat - Concatenate object content to stdout


gsutil cat [-h] url...


The cat command outputs the contents of one or more URLs to stdout. While the cat command does not compute a checksum, it is otherwise equivalent to doing:

gsutil cp url... -

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

Warning: Data Integrity Checking Not Done

The gsutil cat command does not compute a checksum of the downloaded data. Therefore, we recommend that users either perform their own validation of the output of gsutil cat or use gsutil cp or rsync (both of which perform integrity checking automatically).



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.

이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

도움이 필요하시나요? 지원 페이지를 방문하세요.