Use the pre-installed Alibaba Cloud CLI in Cloud Shell to manage Object Storage Service (OSS) resources from your browser without local setup.
Overview
The Alibaba Cloud CLI provides the aliyun oss command suite, a wrapper for the ossutil 1.0 tool pre-installed in Cloud Shell. Available operations include:
-
Buckets: Create, list, delete, and configure buckets.
-
Objects: Upload, download, copy, move, and delete objects.
-
Parts: List and delete parts.
Prerequisites
Launch Cloud Shell before you begin. You can start it using either method:
-
From the Alibaba Cloud Management Console: Click the Cloud Shell icon in the top navigation bar.

-
As a standalone application: Navigate directly to https://shell.aliyun.com.
-
For security, log on as a Resource Access Management (RAM) identity (RAM user or role) instead of the Alibaba Cloud account. The RAM identity must have permissions for the target resources. For more information, see Identity-based policies.
-
Cloud Shell automatically configures CLI credentials based on your logged-on identity. Do not modify or delete the default credential configuration file.
-
The first session provisions a virtual machine (VM), which may take a few moments. Subsequent sessions start faster.
-
Up to five concurrent windows are supported, all sharing the same VM instance.
Getting started: Common examples
The following examples demonstrate common OSS operations.
-
Create a bucket. Use the
mb(make bucket) command. Bucket names must be globally unique. This example creates aStandard-class bucket namedvmeixme.aliyun oss mb oss://vmeixme --storage-class Standard -
Create a directory. Use the
mkdir(make directory) command. This example creates a directory namedhorsein thevmeixmebucket.aliyun oss mkdir oss://vmeixme/horse/ -
List OSS resources. Use the
ls(list) command. This example lists all buckets, objects, and parts, with the result limit set to 20.aliyun oss ls --limited-num 20 -
Get help. Run
aliyun oss --helpto list allosscommands.For details on any command, append
help:aliyun oss [command] helpExample for
mkdir:aliyun oss mkdir help
Command reference
The following tables list all available OSS commands.
Bucket commands
|
Command |
Description |
|
|
Creates a bucket. |
|
|
Lists all buckets, objects, and parts in your account. |
|
|
Deletes buckets, objects, or parts in your account. |
|
|
Configures the access control list (ACL) for a bucket or object. |
|
|
Manages cross-origin resource sharing (CORS) rules for a bucket. |
|
|
Manages lifecycle rules for a bucket. |
|
|
Manages access logging for a bucket. |
|
|
Configures static website hosting and back-to-origin settings for a bucket. |
|
|
Manages encryption configurations for a bucket. |
|
|
Manages bucket policies. |
|
|
Manages hotlink protection configurations for a bucket. |
|
|
Manages tags for a bucket. |
|
|
Configures or queries pay-by-requester settings for a bucket. |
Object commands
|
Command |
Description |
|
|
Uploads, downloads, or copies objects. |
|
|
Creates a logical directory (an empty object with a trailing slash). |
|
|
Displays metadata for a specified bucket or object. |
|
|
Generates a presigned URL for an object. |
|
|
Displays the size of a bucket or the total size of objects in a specified directory. |
|
|
Configures the metadata of an object. |
|
|
Appends content to an appendable object. |
|
|
Outputs object content to stdout. |
|
|
Manages tags for an object. |
|
|
Restores a frozen object to a readable state. |
Other commands
|
Command |
Description |
|
|
Displays help information for a specific command. |
|
|
Lists parts of an incomplete multipart upload task. |
|
|
Queries the details of all parts of an incomplete multipart upload. |
|
|
Calculates the local CRC-64 or MD5 hash of a file. |
|
|
Tests whether a bucket allows a specified cross-origin request. |
|
|
Creates a symbolic link. |
|
|
Monitors OSS access and troubleshoots network or parameter issues during uploads and downloads. |
|
|
Reads the description of a symbolic link. |