4.1 KiB
mc cat
minio
Table of Contents
mc cat
Description
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
.
Common Operations
View an S3 Object
Use mc cat
to
return the object:
mc cat ALIAS/PATH
- Replace
ALIAS <mc cat SOURCE>
with thealias <mc alias>
of the S3-compatible host. - Replace
PATH <mc cat SOURCE>
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 SOURCE>
with thealias <mc alias>
of the S3-compatible host. - Replace
PATH <mc cat SOURCE>
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, specify30d
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 SOURCE>
with thealias <mc alias>
of the S3-compatible host. - Replace
PATH <mc cat SOURCE>
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.
Syntax
~mc cat
has the
following syntax:
mc cat [FLAGS] SOURCE [SOURCE ...]
~mc cat
supports
requires following arguments:
SOURCE
REQUIRED
The object to concatenate.
For objects on S3-compatible hosts, specify the path to the object as
ALIAS/PATH
, where:
ALIAS
is thealias <mc alias>
of a configured S3-compatible host, andPATH
is the path to the object.
mc cat play/mybucket/object.txt
For files on a filesystem, specify the full filesystem path to the
file as SOURCE
:
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).
- Each
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.