All Products
Search
Document Center

Object Storage Service:put-symlink

Last Updated:Jul 03, 2025

The put-symlink command is used to create a symbolic link to an object.

Notes

When you run this command to create a symbolic link, the system does not check whether the object to which the symbolic link points to exists, whether the type of the object is valid, or whether the object can be accessed. The access control list (ACL) of a symbolic link and the ACL of the target object to which the symbolic link points are checked when API operations such as GetObject are called to access the target object.

Permissions

By default, an Alibaba Cloud account has full permissions. RAM users or RAM roles under an Alibaba Cloud account do not have any permissions by default. The Alibaba Cloud account or account administrator must grant operation permissions through RAM Policy or Bucket Policy.

API

Action

Definition

PutSymlink

oss:PutObject

Creates a symbolic link for an object.

oss:PutObjectTagging

When creating a symbolic link for an object, if you specify object tags through x-oss-tagging, this permission is required.

Command syntax

ossutil api put-symlink --bucket value --key value --symlink-target value [flags]

Parameter

Type

Description

--bucket

string

Name of the bucket.

--key

string

Full path of the object.

--object-acl

string

Access control list (ACL) of the object.

--forbid-overwrite

string

Whether to overwrite an object with the same name during the PutSymlink operation.

--storage-class

string

Storage class of the object that you want to upload.

--symlink-target

string

Target object to which the symbolic link points.

Note
  • The put-symlink command corresponds to the PutSymlink operation. For more information about the parameters in the PutSymlink operation, see PutSymlink.

  • For more information about supported global command-line options, see Command-line options.

Example

Create a symbolic link to targetobject.

ossutil api put-symlink --bucket examplebucket --key examplelink --symlink-target targetobject