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).
- 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.
Global Flags
Examples
View an S3 Object
Use mc cat
to return
the object:
mc cat ALIAS/PATH
- Replace
ALIAS <mc cat ALIAS>
with thealias <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 thealias <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, 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 ALIAS>
with thealias <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.