1
0
mirror of https://github.com/minio/docs.git synced 2025-08-05 03:41:24 +03:00
Files
docs/source/reference/minio-mc/mc-cat.rst
Andrea Longo 1f8ce6dec2 Add reference page for mc du (#783)
Create a new reference page for `mc du` and link it in the list of `mc`
commands.

Staged:

http://192.241.195.202:9000/staging/DOCS-764/linux/html/reference/minio-mc/mc-du.html

Includes drive-by fixes to make the _Optional_ notations appear in a
more consistent manner. (Including several otherwise unrelated pages.)
There's more opportunistic fixes here than I might normally do in the
same PR, but seemed better to get it over with.

Fixes https://github.com/minio/docs/issues/764

---------

Co-authored-by: Ravind Kumar <ravind@min.io>
2023-03-30 13:36:41 -06:00

5.1 KiB

mc cat

minio

Table of Contents

mc cat

Syntax

The mc cat command concatenates the contents of a file or object to another file or object. You can also use the command to display the contents of the specified file or object to STDOUT. ~mc cat has similar functionality to cat.

EXAMPLE

The following command concatenates the contents of an object on a MinIO deployment to STDOUT:

mc cat play/mybucket/myobject.txt

SYNTAX

The mc cat command has the following syntax:

mc [GLOBALFLAGS] cat             \
                 [--rewind]      \
                 [--version-id]  \
                 [--encrypt-key] \
                 ALIAS [ALIAS ...]

You can also use mc cat against a local filesystem to produce similar results to the cat commandline tool:

Parameters

ALIAS

Required The alias <alias> of a MinIO deployment and the full path to the object. For example:

mc cat myminio/mybucket/myobject.txt

You can specify multiple objects on the same or different MinIO deployment. For example:

mc cat myminio/mybucket/object.txt myminio/myotherbucket/object.txt

For an object on a local filesystem, specify the full path to that object. For example:

mc cat ~/data/object.txt
--rewind

--version-id, vid

--encrypt-key

Encrypt or decrypt objects using server-side encryption with client-specified keys. Specify key-value pairs as KEY=VALUE.

  • Each KEY represents a bucket or object.
  • Each VALUE represents the data key to use for encrypting

    object(s).

Enclose the entire list of key-value pairs passed to ~mc cat --encrypt-key in double quotes ".

~mc cat --encrypt-key can use the MC_ENCRYPT_KEY environment variable for retrieving a list of encryption key-value pairs as an alternative to specifying them on the command line.

Global Flags

Examples

View an S3 Object

Use mc cat to return the object:

mc cat ALIAS/PATH
  • Replace ALIAS <mc cat ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc cat ALIAS> with the path to the object on the S3-compatible host.

View an S3 Object at a Point-In-Time

Use mc cat --rewind to return the object at a specific point-in-time in the past:

mc cat ALIAS/PATH --rewind DURATION
  • Replace ALIAS <mc cat ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc cat ALIAS> with the path to the object on the S3-compatible host.
  • Replace DURATION <mc cat --rewind> with the point-in-time in the past at which the command returns the object. For example, specify 30d to return the version of the object 30 days prior to the current date.

View an S3 Object with Specific Version

Use mc cat --version-id to return a specific version of the object:

mc cat ALIAS/PATH --version-id VERSION
  • Replace ALIAS <mc cat ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc cat ALIAS> with the path to the object on the S3-compatible host.
  • Replace VERSION <mc cat --version-id> with the specific version of the object to return.

Behavior

S3 Compatibility