All Products
Search
Document Center

Object Storage Service:cat

Last Updated:Mar 20, 2026

Displays the content of an object in a bucket to the screen.

Prerequisites

Before you begin, ensure that you have:

Syntax

ossutil cat oss://bucket/object [flags]

Flags

Use --head or --tail to read from the start or end of an object. To read an arbitrary range, combine --offset and --count.

FlagTypeDescription
--countintNumber of characters to read. Default: -1 (read to the end of the object).
--encoding-typestringEncoding type of the object name. Valid value: url.
--headintRead only the first N characters.
--offsetintStarting position of the display. For example, --offset 10 --count 20 reads 20 characters starting at position 10.
--request-payerstringPayer of the request. If pay-by-requester is enabled for the bucket, set this to requester.
--tailintRead only the last N characters.
--version-idstringVersion ID of the object.

For all available flags, see Command-line options.

Examples

Print full object content

ossutil cat oss://examplebucket/example.txt

Print the first 10 characters

ossutil cat oss://examplebucket/example.txt --head 10

Print the last 10 characters

ossutil cat oss://examplebucket/example.txt --tail 10

Print 20 characters starting at position 10

ossutil cat oss://examplebucket/example.txt --offset 10 --count 20

Print from position 10 to the end

ossutil cat oss://examplebucket/example.txt --offset 10