---
name: cloud-object-storage-minio
title: Using Minio Client
description: The open source Minio Client could be your solution for using UNIX-like commands (`ls`, `cp`, `cat`, and so on) with IBM Cloud&reg; Object Storage.
last-updated: 2024-04-18
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/cloud-object-storage?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Using Minio Client
{: #minio}

The open source [Minio Client](https://min.io/download#/linux){: external} could be your solution for using UNIX-like commands (`ls`, `cp`, `cat`, and so on) with IBM Cloud&reg; Object Storage.
{: shortdesc}

## Installation
{: #minio-install}

You can find installation instructions for each operating system is available in the [Quick Start guide](https://docs.min.io/docs/minio-client-quickstart-guide.html){: external} on the Minio website.

## Configuration
{: #minio-config}

Adding your Object Storage is accomplished by running the following command:

```
mc config host add <ALIAS> <COS-ENDPOINT> <ACCESS-KEY> <SECRET-KEY>
```

* `<ALIAS>` - short name for referencing Object Storage in commands
* `<COS-ENDPOINT` - endpoint for your Object Storage instance. For more information about endpoints, see [Endpoints and storage locations](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints&format=markdown#endpoints).
* `<ACCESS-KEY>` - access key that is assigned to your Service Credential
* `<SECRET-KEY>` - secret key that is assigned to your Service Credential

The `<ACCESS-KEY>` and `<SECRET-KEY>` can be accessed/generated using [HMAC](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-uhc-hmac-credentials-main&format=markdown)
{:tip}

The configuration information is stored in a JSON file that is at `~/.mc/config.json`

```
mc config host add cos https://s3.us-south.cloud-object-storage.appdomain.cloud xx1111cfbe094710x4819759x57e9999 9f99fc08347d1a6xxxxx0b7e0a9ee7b0c9999c2c08ed0000
```

## Sample Commands
{: #minio-commands}

A complete list of commands and optional flags and parameters are documented in the [Minio Client Complete Guide](https://docs.min.io/docs/minio-client-complete-guide){: external}

### `mb` - Make a Bucket
{: #minio-mb}

```
mc mb cos/my_test_bucket
```

### `ls` - List Buckets
{: #minio-ls}

Though all your available buckets are listed, not all objects might be accessible depending on the specified [endpoint's](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints&format=markdown#endpoints) region.
{: tip}

```
mc ls cos
```

```
[2018-06-05 09:55:08 HST]     0B testbucket1/
[2018-05-24 04:17:34 HST]     0B testbucket_south/
[2018-10-15 16:14:28 HST]     0B my_test_bucket/
```


### `ls` - List Objects
{: #minio-ls-objects}

```
mc ls cos/testbucket1
```

```
[2018-11-12 08:09:53 HST]    34B mynewfile1.txt
[2018-05-31 01:49:26 HST]    34B mynewfile12.txt
[2018-08-10 09:49:08 HST]  20MiB newbigfile.pdf
[2018-11-29 09:53:15 HST]    31B testsave.txt
```

### `find` - Search for Objects by Name
{: #minio-find}

A full list of search options is available in the [complete guide](https://docs.min.io/docs/minio-client-complete-guide#find){: external}
{: tip}

```
mc find cos/testbucket1 --name my*
```

```
[2018-11-12 08:09:53 HST]    34B mynewfile1.txt
[2018-05-31 01:49:26 HST]    34B mynewfile12.txt
```

### `head` - Display few lines of object
{: #minio-head}

```
mc head cos/testbucket1/mynewfile1.txt
```

### `cp` - Copy objects
{: #minio-cp}

This command copies an object between two locations. These locations can be different hosts (such as different [endpoints](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints&format=markdown#endpoints) or storage services) or local file system locations (such as `~/foo/filename.pdf`).
```
mc cp cos/testbucket1/mynewfile1.txt cos/my_test_bucket/cp_from_minio.txt
```

```
...1/mynewfile1.txt:  34 B / 34 B  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  100.00% 27 B/s 1s
```

### `rm` - Remove objects
{: #minio-rm}

*More removal options are available on the [complete guide](https://docs.min.io/docs/minio-client-complete-guide#rm){: external}*

```
mc rm cos/my_test_bucket/cp_from_minio.txt
```

### `pipe` - Copies STDIN to an object
{: #minio-pipe}

```
echo -n 'this is a test' | mc pipe cos/my_test_bucket/stdin_pipe_test.txt
```