1
0
mirror of https://github.com/minio/docs.git synced 2025-07-31 18:04:52 +03:00
Files
docs/source/reference/minio-mc/mc-ls.rst

5.3 KiB

mc ls

minio

Table of Contents

mc ls

Syntax

The mc ls command lists buckets and objects on MinIO or another S3-compatible service.

You can also use mc ls against the local filesystem to produce similar results as the ls command.

EXAMPLE

The following command lists all objects and object versions in the mydata bucket on the myminio MinIO deployment:

mc ls --recursive --versions myminio/mydata

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] ls              \
                 [--incomplete]  \
                 [--recursive]   \
                 [--rewind]      \
                 [--versions]    \
                 [--summarize]   \
                 ALIAS [ALIAS ...]

Parameters

ALIAS

Required The object or objects to copy.

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

mc ls play/mybucket/object.txt

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

mc ls ~/mydata/object.txt

If you specify a directory or bucket to ~mc ls ALIAS, you must also specify ~mc ls --recursive to recursively list the contents of that directory or bucket. If you omit the --recursive argument, ~mc ls only lists objects in the top level of the specified directory or bucket.

incomplete, -I

Optional Returns any incomplete uploads on the specified ~mc ls ALIAS bucket.

--recursive, r

Optional Recursively lists the contents of each bucket or directory in the ~mc ls ALIAS.

--rewind

Use ~mc ls --rewind and ~mc ls --versions together to display on those object versions which existed at a specific point in time.

--versions

Use ~mc ls --versions and ~mc ls --rewind together to display on those object versions which existed at a specific point in time.

--summarize

Optional Displays summarized information for the specified ALIAS path.

Global Flags

Examples

List Bucket Contents

Use mc ls <mc ls ALIAS> to list the contents of a bucket:

mc ls [--recursive] ALIAS/PATH
  • Replace ALIAS <mc ls ALIAS> with the alias <mc alias> of the S3-compatible host.

  • Replace PATH <mc ls ALIAS> with the path to the bucket on the S3-compatible host.

    If specifying the path to the S3 root (ALIAS only), include the ~mc ls --recursive option.

List Object Versions

Use mc ls --versions to list all versions of an object:

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

List Bucket Contents at Point in Time

Use mc ls --versions to list all versions of an object:

mc ls --rewind DURATION ALIAS/PATH
  • Replace ALIAS <mc ls ALIAS> with the alias <mc alias> of the S3-compatible host.
  • Replace PATH <mc ls ALIAS> with the path to the bucket or object on the S3-compatible host.
  • Replace DURATION <mc ls --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.

Behavior

S3 Compatibility