# Sử dụng MinIO Client

MinIO Client là một trong những công cụ quản lý Object Storage phổ biến trên giao diện dòng lệnh. Hỗ trợ người dùng đã dạng thao tác thuận tiện hơn các bucket, object cũng như các tính năng khác trong Object Storage.

Xem thêm tại: <https://min.io/docs/minio/linux/reference/minio-mc.html>

Bài viết này sẽ hướng dẫn cách thiết lập và sử dụng X-OR Cloud Object Storage thông qua MinIO Client

## 1. Cài đặt MinIO Client

Trên Linux chạy các lệnh sau

```bash
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
  --create-dirs \
  -o $HOME/minio-binaries/mc

chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/
```

## **2. Thiết lập user profile**

Để thiết lập user profile, cần cung cấp `Access Key` và `Secret Key` của bucket, các thông tin này có thể lấy được trên Portal của X-OR Cloud như sau:

<figure><img src="/files/kvOmD5FIcl2UNCEidlHQ" alt=""><figcaption><p>Giáo diện quản lý thông tin bucket</p></figcaption></figure>

Dùng các key đã có và tạo một profile/alias cho user của bạn, ví dụ ở đây sẽ tạo một profile với tên `my-oss:`

```bash
mc alias set --api "S3v4" my-oss https://s3.xorcloud.net "<Access Key>" "<Secret Key>"
```

MinIO client còn có một thế mạnh cho phép tạo nhiều nhiều hơn một profile giúp người dùng quản lý nhiều tài khoản trên nhiều môi trường Object Storage khác nhau. List các profile đã được thêm:

```bash
mc alias list
```

Như vậy người dùng đã có thể sử dụng MinIO client để thao tác dễ dàng với Object Storage. Một vài câu lệnh thường dùng:

```bash
mc mb my-oss/bucket-name # tạo bucket mới
mc cp file_name my-oss/bucket-name/folder_name # copy file từ local lên bucket
mc rm my-oss/bucket-name/folder_name/file_name # xóa file trong bucket
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.x-or.cloud/san-pham/x-or-data/huong-dan/su-dung-minio-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
