--- title: "Connect with the mc client" description: "Install the MinIO mc client, add your bucket as an alias, and upload, list, and remove objects from the command line." content_type: "how-to" product: "object-storage" platform: "MyAccount" url: "/myaccount/object-storage/how-to/connect-with-the-mc-client/" topic: ["create-and-connect"] relationships: {"requires":["/myaccount/object-storage/how-to/generate-an-access-key/"]} --- # Connect with the mc client `mc`, the MinIO client, is one way to work with a bucket from the command line, built by the same team behind the SDKs E2E recommends. You need a bucket and an access key first; see [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). ## Install mc Download `mc` from MinIO's [AIStor Client download page](https://www.min.io/download/aistor-client). Choose your operating system and architecture there, and the page shows the file to download and the commands to install it. On a 64-bit Intel or AMD Linux machine, for example: ```bash frame="none" wget https://dl.min.io/aistor/mc/release/linux-amd64/mc chmod +x mc ``` On macOS, install it with Homebrew instead: ```bash frame="none" brew install minio/aistor/mc ``` An `mc` you installed earlier from MinIO's older download links keeps working with every command on this page. Confirm it runs (`mc.exe --help` on Windows): ```bash frame="none" mc --help ``` Add it to your PATH (for example, `mv mc /usr/local/bin` on Linux or macOS) so you can run it from anywhere. ## Add your bucket as an alias ```bash frame="none" mc alias set ``` Use `https://objectstore.e2enetworks.net` for a Delhi bucket, or the Chennai endpoint from [S3 compatibility](/myaccount/object-storage/concepts/s3-compatibility/) for one there, along with the access key and secret key from [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). Pick a short, memorable `alias-name`: you will use it in every `mc` command on this page instead of typing your credentials again. When the alias is saved, `mc` confirms it: ```text Added `` successfully. ``` Check that the alias reaches your bucket by listing it. Each object prints on its own line, with the time it was last changed, its size, and its name: ```bash frame="none" mc ls // ``` ```text [2026-09-23 10:15:02 IST] 1.2MiB STANDARD report.pdf [2026-09-23 10:16:40 IST] 48KiB STANDARD notes.txt ``` An empty bucket prints nothing. An access denied error means the key is not attached to this bucket, or its role does not allow what you asked; see [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). An older release of `mc` may not know `mc alias`. Update it, or use the older form of the same command: ```bash frame="none" mc config host add ``` ## Work with objects List what is in a bucket: ```bash frame="none" mc ls // ``` Upload a file: ```bash frame="none" mc cp // ``` Add `--recursive` to copy a whole folder. Remove an object: ```bash frame="none" mc rm // ``` To clear out a bucket but keep the bucket itself, remove every object in it at once. This cannot be undone, so check the bucket name first: ```bash frame="none" mc rm --recursive --force // ``` The bucket's **Empty** action in MyAccount does the same from the dashboard. Check how much space a bucket is using: ```bash frame="none" mc du // ``` Search for an object by name: ```bash frame="none" mc find // --name "" ``` Print an object's contents straight to your terminal, or pipe data from another command straight into one: ```bash frame="none" mc cat // | mc pipe // ``` Print only the first few lines of a large object instead of the whole thing: ```bash frame="none" mc head -n // ``` `mc pipe` streams data into a bucket without writing it to disk first, which suits backups. This dumps a MySQL database straight into a bucket: ```bash frame="none" mysqldump -u -p | mc pipe //backups/.sql ``` Enter the database password when asked; the dump uploads as it is written. When your prompt comes back, the file is in the bucket, and you can list it with `mc ls //backups/`. For a scheduled backup with s3cmd instead, see [Back up a MySQL database to E2E Object Storage](/myaccount/object-storage/how-to/back-up-a-mysql-database-to-object-storage/). Remove an upload that failed partway through instead of a finished object: ```bash frame="none" mc rm --incomplete // ``` Generate a presigned download link, valid for the duration you set: ```bash frame="none" mc share download // --expire= ``` Replace `` with a number followed by `h` for hours, `m` for minutes, or `s` for seconds, for example `--expire=12h`. A link can last at most 7 days, which is `168h`. Check a bucket is reachable, and list every version of every object if [Object Versioning](/myaccount/object-storage/how-to/turn-on-object-versioning/) is on: ```bash frame="none" mc ready // mc ping // --count 4 mc ls --recursive --versions // ``` Update mc itself to the latest version: ```bash frame="none" mc update ``` ## Work that happens outside mc `mc` works on the objects inside the buckets your key is attached to. Creating a bucket, listing every bucket on your account, and turning on public access happen in the dashboard or through the MyAccount API. The same goes for `mc`'s admin commands, such as `mirror`, `watch`, `policy`, `admin`, and `config`, because an access key reaches objects in its buckets, not the account itself. See [S3 compatibility](/myaccount/object-storage/concepts/s3-compatibility/) for the full picture, including why a permission-related warning during setup is expected and safe to ignore. If a command fails, see [Troubleshooting E2E Object Storage](/myaccount/object-storage/troubleshooting/object-storage/).