LinuxCommandLibrary

mc.cli

Visually manage files and directories

TLDR

Add connection to a S3 server

$ mc alias set [local] [http://localhost:9000] [access_key] [secret_key]
copy

Create a bucket
$ mc mb [local/bucket_name]
copy

List buckets and their content recursively
$ mc ls [local] --recursive
copy

SYNOPSIS

mc <command> [<arguments...>] [<flags...>]

Examples:
mc ls s3-alias/mybucket
mc cp local-file.txt s3-alias/mybucket/
mc admin info s3-alias

PARAMETERS

command
    The specific operation to perform (e.g., ls, cp, mb, admin). Each command has its own set of arguments and flags.

arguments...
    Values required by the specific command, such as source/target paths, bucket names, or user credentials.

flags...
    Optional modifiers that alter the behavior of the command or provide additional functionality.

--config-dir <path>
    Specifies the path to the configuration folder for mc.

--quiet
    Suppresses verbose output, showing only essential information or errors.

--no-color
    Disables color output in the terminal.

--json
    Formats the output as JSON, useful for scripting and programmatic consumption.

--debug
    Enables debug output, providing more detailed information for troubleshooting.

--insecure
    Disables TLS/SSL certificate verification when connecting to servers. Use with caution in production.

--version
    Prints the mc client version and exits.

-h, --help
    Displays help information for mc or a specific subcommand.

DESCRIPTION

The mc command, commonly referred to as the MinIO Client command-line interface (CLI), is a powerful and versatile tool for interacting with S3-compatible object storage systems, including MinIO servers and Amazon S3. It provides a rich set of functionalities that mimic standard Unix commands, allowing users to perform operations like listing objects, copying files, creating and removing buckets, and synchronizing data efficiently from the terminal.

mc is designed for high-performance and large-scale data operations, making it an essential utility for developers and administrators working with object storage. It supports various authentication methods and offers features like server-side encryption, versioning, and lifecycle management, providing comprehensive control over data stored in object storage environments. The mc client is cross-platform, available for Linux, macOS, and Windows.

CAVEATS

Using the --insecure flag should be strictly avoided in production environments due to significant security risks.
Operations involving large datasets (e.g., mc mirror, mc cp -r) can consume substantial network bandwidth and local disk space.
mc operations are constrained by the permissions of the credentials used, which are managed on the S3 server side.

ALIASES

Before using mc to interact with remote S3 endpoints, you typically need to configure an alias using the mc alias set command. An alias assigns a short name to an S3 endpoint along with its access credentials, simplifying subsequent commands (e.g., my-s3-alias/mybucket instead of a full URL and credentials).

CORE OPERATIONS

mc supports a wide range of operations categorized into various subcommands, including but not limited to:
Data Management: ls, cp, mv, rm, cat, stat, mb, rb, mirror, find.
Configuration & Alias Management: alias, config.
Administrative Tasks: admin (for managing MinIO servers, e.g., users, policies, server info, service restart).
This broad set of commands allows for comprehensive management of object storage.

HISTORY

The mc command is an integral part of the MinIO project, an open-source, high-performance object storage server compatible with Amazon S3 APIs. Developed by MinIO Inc., mc was created to provide a native, efficient, and user-friendly command-line interface for interacting with MinIO servers and other S3-compatible services.

Its development has focused on mimicking familiar Unix commands to ease adoption, while also incorporating features specific to object storage, such as parallel uploads and downloads, and advanced administrative capabilities. mc has continuously evolved alongside the MinIO server, with regular updates introducing new commands, improving performance, and enhancing security features, making it a robust tool for modern cloud-native applications and data infrastructure.

SEE ALSO

aws(1), s3cmd(1), rclone(1), ls(1), cp(1)

Copied to clipboard