6.4 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 \
ALIAS [ALIAS ...] \
[--enc-c "value"] \
[--offset "int"] \
[--part-number "int"] \
[--rewind] \
[--tail "int"] \
[--version-id "string"] \
[--zip]
You can also use mc cat
against a local filesystem to produce similar
results to the cat
commandline tool.
Parameters
ALIAS
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
--offset
Specify an integer that is the number of bytes from which the command offsets the output.
Mutually exclusive with the ~mc cat --part-number
flag.
--part-number
Download a specific part number of a multi-part upload. Specify the integer of the part number to download.
Mutually exclusive with the ~mc cat --offset
and ~mc cat --tail
flags.
--rewind
--tail
Specify an integer that is the number of bytes from which the command trims the output.
Mutually exclusive with the ~mc cat --part-number
flag.
--version-id, vid
--zip
Extracts the contents from a zip file on the source to the remote.
Requires a MinIO deployment as the source ALIAS
.
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.
Download a particular part
Use mc cat --part-number
to download a particular part
of a multi-part upload:
mc cat ALIAS/PATH --part-number=#
- 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
#
with the integer of the part number to download. For example, to download part 3 of at 16-part multi-part file, use--part-number=3
.
You cannot use the --part-number
flag if you are using
either the --offset
or the --tail
flags.