mc ls

Lists buckets and objects on a local cluster or a remote fabric of the global namespace (GNS).

Syntax

Use the command to list buckets and objects from the local cluster or a cluster/fabric from a cluster group/global namespace.

NOTE
To list the fabrics/clusters and the external S3 servers that have been imported into the global namespace, use gns as the bucket name.
CLI
mc ls [FLAGS] TARGET [TARGET ...]

FLAGS:
  --account value               list buckets of the account
  --versions                    list all versions
  --recursive, -r               list recursively
  --summarize                   display summary information (number of objects, total size)
  --json                        enable JSON lines formatted output
  --debug                       enable debug output
  --insecure                    disable SSL certificate verification
  --help, -h                    show help

Parameters

Parameter Description
TARGET The alias of a configured HPE Ezmeral Object Store deployment from which the command lists buckets and objects. This parameter is mandatory. To list buckets and objects from a remote cluster/fabric in the global namespace use the format <fabricname>-<bucketname> instead of only the <bucketname> after the alias, that is <alias>/<fabricname>-<clustername>.When bucketname is mentioned without the fabric name, Data Fabric checks the local cluster for the specified bucketname.
account The account from which buckets and objects are listed. If not specified, buckets and objects from all accounts are listed.
versions List all versions of an object, including those with delete markers.
recursive Recursively lists objects from all folders and not just the top level folder.
summarize Display the total size and number of objects in the target.
json Enable JSON formatted output.
debug Enable output for debugging.
insecure Disable SSL verification.
help Show this help.

Examples

  1. List buckets in the object store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc ls salesobject -json
  2. List all buckets in the account asia in the object store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc ls --account asia salesobject -json
  3. List all buckets recursively from the object store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc ls --recursive salesobject -json
  4. List all buckets recursively from the object store deployment with alias salesobject and display the total number of objects and the total size:
    CLI
    /opt/mapr/bin/mc ls --recursive --summarize salesobject -json
  5. List all objects from the object store deployment with alias salesobject containing the bucket bucket1 from the cluster /fabric cluster1 and display the total number of objects and the total size:
    CLI
    /opt/mapr/bin/mc ls salesobject/cluster1-bucket1/ -json
  6. List all buckets from the object store deployment with the alias named clalias on the cluster named securecluster
    CLI
    /opt/mapr/bin/mc ls clalias/securecluster/
  7. List all objects, that is, the list of fabrics and external S3 servers on the global namespace (gns) on the object store deployment with alias named clalias
    CLI
    /opt/mapr/bin/mc ls clalias/gns/