1
0
mirror of https://github.com/minio/docs.git synced 2025-08-06 14:42:56 +03:00
Files
docs/source/reference/minio-mc/mc-head.rst
Ravind Kumar 76e5e35ab3 DOCS-1191: Updating SSE params, general fixups (#1295)
Closes #1191 

# Summary

Finally getting around to this mc release

- Added docs for enc-c, enc-s3, enc-kms
- Some docs are making assumptions around behavior that needs to be
fixed _first_
- Drive-by linker fixes

Staged: http://192.241.195.202:9000/staging/DOCS-1191/linux/index.html

---------

Co-authored-by: Andrea Longo <feorlen@users.noreply.github.com>
Co-authored-by: Daryl White <53910321+djwfyi@users.noreply.github.com>
2024-08-26 11:54:49 -04:00

5.2 KiB

mc head

minio

Table of Contents

mc head

Syntax

The mc head command displays the first n lines of an object, where n is an argument specified to the command.

mc head does not perform any transformation or formatting of object contents to facilitate readability. You can also use mc head against the local filesystem to produce similar results to the head commandline tool.

EXAMPLE

The following command returns the first 10 lines of an object in the mydata bucket on the myminio MinIO deployment:

mc head myminio/mydata/myobject.txt

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] head                     \
                 [--lines int]            \
                 [--rewind "string"]      \
                 [--version-id "string"]  \
                 [--enc-c "string"]       \
                 ALIAS [ALIAS ...]

Parameters

ALIAS

The object or objects to print.

For an object on MinIO, specify the alias <alias> and the full path to that object (e.g. bucket and path to object). For example:

mc head play/mybucket/object.txt

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

mc head ~/mydata/object.txt myminio/mydata/object.txt

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

mc head ~/mydata/object.txt

--lines, n

The number of lines to print.

Defaults to 10.

--rewind

--version-id, vid

Global Flags

Examples

View Partial Contents of an Object

Use mc head to return the first 10 lines of an object:

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

View Partial Contents of an Object at a Point in Time

Use mc head --rewind to return the first 10 lines of the object at a specific point-in-time in the past:

mc head ALIAS/PATH --rewind DURATION
  • Replace ALIAS <mc head ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc head ALIAS> with the path to the object on the S3-compatible host.
  • Replace DURATION <mc head --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 Partial Contents of an Object with Specific Version

Use mc head --version-id to return the first 10 lines of the object at a specific point-in-time in the past:

mc head ALIAS/PATH --version-id VERSION
  • Replace ALIAS <mc head ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc head ALIAS> with the path to the object on the S3-compatible host.
  • Replace VERSION <mc head --version-id> with the version of the object. For example, specify 30d to return the version of the object 30 days prior to the current date.

Behavior

S3 Compatibility