> For the complete documentation index, see [llms.txt](https://docs.oortech.com/oort/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oortech.com/oort/oort-storage/manage-storage/tools-and-clients/use-aws-cli.md).

# Use AWS CLI

**What is AWS CLI?**

The AWS CLI or Amazon Web Services Command Line Interface is a command-line tool developed by Amazon in Python to transfer data to an object storage service. This is one of the most used CLI tools for IT system administrators, developers, and programmers. Although this tool was developed by Amazon, you can use it with any S3-compatible API object storage service, including OORT Storage, to manage your storage objects and buckets.

For more information on AWS CLI, see [AWS CLI Help](https://docs.aws.amazon.com/cli/latest/reference/s3/).

## **Prerequisites**

* [x] [Download and install](https://aws.amazon.com/cli/) AWS CLI tools.
* [x] [Sign up](https://console.oortech.com/signup) for a free OORT account.
* [x] Get Access Key and Access Secret Keys. Learn how to view your access keys [here](/oort/oort-storage/developing-with-oort-storage/access-keys.md).

Access Key and Access Secret Keys will be stored in the AWS CLI configuration file, but each command needs to reference the API endpoint.&#x20;

## **Configure AWS** CLI

1. First, configure the AWS CLI to use OORT Storage. To do this, open a new terminal window. From there, run the command:&#x20;

```
aws configure
```

The command will generate a series of prompts, fill in the following:

* **Access Key ID:** Vault Access Key
* **Secret Access Key:** Vault Secret Key
* **Region:** us-east-1
* **Output Format:**&#x4F;ptional

```
aws configure set default.s3.signature_version s3v4
```

2. After completing the prompts, start using the AWS CLI tools to interact with the OORT Storage S3 Compatible API. As long as your access ID and secret access key remain the same, you do not need to configure the AWS CLI again.&#x20;

All AWS CLI commands will start with the section following this initial command, which will determine what to do and what bucket to use.

{% hint style="info" %}
OORT Storage Endpoint API:&#x20;

Standard：<https://s3-standard.oortech.com>

Archive：[https://s3-archive.oortech.com](https://s3-standard.oortech.com)
{% endhint %}

```
aws --endpoint https://s3-standard.oortech.com
```

## **Crete a bucket**

To create a new bucket on OORT Storage using the AWS CLI, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 mb s3://[bucket-name]
```

For example, to create a new bucket named "mybucket":

```
aws --endpoint https://s3-standard.oortech.com s3 mb s3://mybucket
```

Bucket names must be unique across all ***Oort*** users, be between 3 and 63 characters long, and can only contain lowercase characters, numbers, and dashes.&#x20;

The terminal should return the following line:

```
make_bucket: mybucket
```

## **Display buckets**

The following command will list all buckets in your Oort account:

```
aws --endpoint https://s3-standard.oortech.com s3 ls
```

## **Upload a file**

To upload a single file, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 cp [filename] s3://[bucket-name]
```

For example, to upload a file named "myphoto.png" to the bucket "mybucket":

```
aws --endpoint https://s3-standard.oortech.com s3 cp ~/Photos/myphoto.png s3://mybucket
```

To verify that this file was uploaded by listing the contents of the bucket with the command used earlier: `s3 ls`

```
aws --endpoint https://s3-standard.oortech.com s3 ls s3://mybucket
```

To verify that this file is available from the web console, go to <https://console.oortech.com>

To upload multiple objects, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 sync [folder name] s3://[bucket-name]
```

For example, to upload the contents of a folder named "Photos", use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 sync ~/Photos/ s3://mybucket/Photos/
```

## **List files in a bucket**

To list the files of a bucket, use the following command:&#x20;

```
aws --endpoint https://s3-standard.oortech.coms3 ls s3://[bucket-name]
```

For example, to list the files of 'mybucket':&#x20;

```
aws --endpoint https://s3-standard.oortech.com s3 ls s3://mybucket
```

## **Move a file**

To move from bucket 1 to bucket 2, use the following command:

```
aws --endpoint-url https://s3-standard.oortech.com s3 mv s3://[bucket-name1]/[file-name] s3://[bucket-name2]/
```

## **Copy a file**

To copy from bucket 1 to bucket 2, use the following command:

```
aws --endpoint-url https://s3-standard.oortech.com s3 cp s3://[bucket-name1]/[file-name] s3://[bucket-name2]/
```

## **Download a file**

To download a single file, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 cp s3://[bucket-name]/[file-name] /path/to/download/filename
```

For example, to download a file named "myphoto.png" from the bucket "mybucket":

```
aws --endpoint https://s3-standard.oortech.com s3 cp s3://mybucket/Photos/myphoto.png ~/Photos/myphoto.png
```

## **Download a folder**

To download a folder, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 cp --recursive s3://[bucket-name]/[folder name] /path/to/download/folder
```

For example, to upload the contents of a folder named "photos", use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 cp --recursive s3://mybucket/photos ~/Photos
```

## **Delete a file**

To delete files, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 rm s3://[bucket_name]/[file_name]
```

**Delete all files in a bucket**

To delete all files in the bucket, use the following command:

```
aws --endpoint https://s3-standard.oortech.com s3 rm --recursive s3://[bucket_name]/
```

For example, to delete all files from the bucket "mybucket":

```
aws --endpoint https://s3-standard.oortech.com s3 rm --recursive s3://mybucket/
```

**Generate a presigned S3 URL using the AWS CLI**

To create a presigned URL using the AWS CLI, use the following command syntax:

```
aws s3 --endpoint https://s3-standard.oortech.com presign s3://mybucket/file.name
```

This command should return a presigned URL. By default, the expiration time is one hour.

You can specify different expiration times by adding flags and minutes. --expires-in


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.oortech.com/oort/oort-storage/manage-storage/tools-and-clients/use-aws-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
