1
0
mirror of https://github.com/minio/docs.git synced 2025-07-28 19:42:10 +03:00
Files
docs/source/reference/minio-mc/mc-ls.rst
Andrea Longo 1f8ce6dec2 Add reference page for mc du (#783)
Create a new reference page for `mc du` and link it in the list of `mc`
commands.

Staged:

http://192.241.195.202:9000/staging/DOCS-764/linux/html/reference/minio-mc/mc-du.html

Includes drive-by fixes to make the _Optional_ notations appear in a
more consistent manner. (Including several otherwise unrelated pages.)
There's more opportunistic fixes here than I might normally do in the
same PR, but seemed better to get it over with.

Fixes https://github.com/minio/docs/issues/764

---------

Co-authored-by: Ravind Kumar <ravind@min.io>
2023-03-30 13:36:41 -06:00

5.7 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

The output resembles the following:

[2022-11-08 11:30:24 PST]    52MB  STANDARD log-data.csv
[2022-11-09 12:20:18 PST]    120MB WARM videos/event-2022-11-09.mp4
  • STANDARD marks objects stored on the MinIO deployment
  • WARM marks objects stored on the remote tier with matching name
  • videos/ indicates the prefix for the object

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