tencent cloud

Creating/Obtaining a Symbolic Link - symlink
Last updated: 2025-05-09 18:27:39
Creating/Obtaining a Symbolic Link - symlink
Last updated: 2025-05-09 18:27:39
The symlink command is used to create or obtain a symbolic link to an object. You can quickly find the object through this symbolic link.
Note:
If you need to use the command to create a symbolic link, when you perform authorization policy, set action to cos:PutBucket.
If you need to use the command to obtain a symbolic link, when you perform authorization policy, set action to cos:GetObject.
For more authorizations, please refer to CAM-Enabled API.

Command Syntax

./coscli symlink --method create cos://<bucket-name>/<key> --link linkKey [flag]
The symlink command includes the following parameters:
Parameter Format
Description
Example
cos://<bucket-name>
Specifies the target bucket, which is accessible by using the bucket alias or bucket name configured in the configuration file as detailed in Download and Installation Configuration. If you use the bucket name for access, you also need to include the endpoint flag.
Access with the bucket alias: cos://example-alias
Access with the bucket name: cos://examplebucket-1250000000
/<key>
Specifies the object name.
/test
The symlink command includes the following optional flags:
Flag Abbreviation
Flag Name
Description
-h
--help
Views the usage of this command.
No
--method
Valid values: create/get.
No
--link
Specifies the symbolic link key value.

Operation Example

Creating a symbolic link named symlink for picture.jpg in the bucket1 bucket

./coscli symlink --method create cos://bucket1/picture.jpg --link symlink

Accessing the target object via the symlink

./coscli symlink --method get cos://bucket2 --link symlink


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback