mc head

Displays the first n lines of an object.

The mc head command automatically decompresses gzip and bzip2 compressed objects.

Syntax

CLI
mc head - display first 'n' lines of an object

USAGE:
  mc head [FLAGS] SOURCE [SOURCE...]

FLAGS:
  -n value, --lines value          print the first 'n' lines (default: 10)
  --version-id value, --vid value  select an object version to display
  --json                           enable JSON lines formatted output
  --debug                          enable debug output
  --insecure                       disable SSL certificate verification
  --help, -h                       show help

Parameters

Parameter Description
SOURCE The alias of a configured HPE Ezmeral Object Store deployment from which the command reads objects. This parameter is mandatory.
lines The number of lines to read from the object. The default value is 10.
version-id The object version to read.
json Enable JSON formatted output.
debug Enable output for debugging.
insecure Disable SSL verification.
help Show this help.

Examples

  1. Display the first seven lines from a gzip compressed object named secret.csv.gz that is present in a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc head --lines 7 salesobject/northamerica/secret.csv.gz
  2. Display the first twelve lines from a gzip compressed object named secret.csv.gz with version ID 3ddac055-89a7-40fa-8cd3-530a5581b6b8 that is present in a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc head --lines 12 --version-id="3ddac055-89a7-40fa-8cd3-530a5581b6b8" salesobject/northamerica/secret.csv.gz