All Products
Search
Document Center

Cloud Shell:Manage OSS data with Alibaba Cloud CLI in Cloud Shell

Last Updated:Mar 05, 2026

Cloud Shell provides a pre-configured environment with the Alibaba Cloud CLI, enabling you to manage your Object Storage Service (OSS) resources directly from your browser without any local installation or configuration.

Overview

The Alibaba Cloud CLI provides the aliyun oss command suite to interact with OSS. These commands are a user-friendly wrapper for the powerful ossutil 1.0 tool, which is also pre-installed in Cloud Shell. By using the CLI in Cloud Shell, you can perform a wide range of operations on your OSS resources, including:

  • Buckets: Create, list, delete, and configure buckets.

  • Objects: Upload, download, copy, move, and delete objects.

  • Parts: List and delete parts.

Prerequisites

Before you begin, ensure you have launched Cloud Shell. You can start Cloud Shell using one of the following methods:

Note
  • To ensure security, we recommend logging on to the console and using Cloud Shell as a RAM identity (RAM user or RAM role) instead of the Alibaba Cloud account. The RAM identity must have the necessary permissions to manage the resources you intend to work with. For more information, see Identity-based policies.

  • When you start Cloud Shell, it automatically configures the CLI with credentials based on your logged-on identity. Do not modify or delete the default credential configuration file.

  • The first time you start Cloud Shell, a virtual machine (VM) instance is provisioned for you, which may take a few moments. Subsequent sessions will start faster.

  • You can open up to five concurrent windows. All sessions share the same underlying VM instance.

Getting started: Common examples

The following examples show how to perform common OSS operations in Cloud Shell.

  1. Create a bucket. Use the mb (make bucket) command. Bucket names must be globally unique. The following example creates a bucket named vmeixme of the Standard class.

    aliyun oss mb oss://vmeixme --storage-class Standard
  2. Create a directory in a bucket. Use the mkdir (make directory) command. The following example creates a directory named horse in the vmeixme bucket.

    aliyun oss mkdir oss://vmeixme/horse/
  3. List OSS resources in your account. Use the ls (list) command. The following example lists all OSS resources (buckets, objects, and parts) within your account, with the maximum number of returned results set to 20.

    aliyun oss ls --limited-num 20
  4. Get help. Run the aliyun oss --help command to view a list of all oss commands.

    To get detailed information about any command, append help to the command.

    aliyun oss [command] help

    For example, to get help for the mkdir command:

    aliyun oss mkdir help

Command reference

The following tables list all available commands for managing OSS.

Bucket commands

Command

Description

mb

Creates a bucket.

ls

Lists all buckets, objects, and parts in your account.

rm

Deletes buckets, objects, or parts in your account.

set-acl

Configures the access control list (ACL) for a bucket or object.

cors

Manages cross-origin resource sharing (CORS) rules for a bucket.

lifecycle

Manages lifecycle rules for a bucket.

logging

Manages access logging for a bucket.

website

Configures static website hosting and back-to-origin settings for a bucket.

bucket-encryption

Manages encryption configurations for a bucket.

bucket-policy

Manages bucket policies.

referer

Manages hotlink protection configurations for a bucket.

bucket-tagging

Manages tags for a bucket.

request-payment

Configures the pay-by-requester mode for a bucket or queries the pay-by-requester configurations of a bucket.

Object commands

Command

Description

cp

Uploads, downloads, or copies objects.

mkdir

Creates a logical directory (an empty object with a trailing slash).

stat

Displays metadata for a specified bucket or object.

sign

Generates a presigned URL for an object.

du

Displays the size of a bucket or the total size of objects under a specified directory.

set-meta

Configures the metadata of an object.

appendfromfile

Appends content to an appendable object.

cat

Exports object content to stdout.

object-tagging

Manages tags for an object.

restore

Restores an object from the frozen state to the readable state.

Other commands

Command

Description

help

Displays help information for a specific command.

listpart

Lists parts of an incomplete multipart upload task.

getallpartsize

Queries the details of all parts of an incomplete multipart upload task.

hash

Calculates the local CRC-64 or MD5 hash of a file.

cors-options

Tests whether a bucket allows a specified cross-origin request.

create-symlink

Creates a symbolic link.

probe

Monitors access to OSS. You can also run this command to troubleshoot issues that are caused by network faults or invalid parameter settings during the upload and download process.

read-symlink

Reads the description of a symbolic link.