阿里云 云存储OSS的命令行使用

    xiaoxiao2026-05-18  11

    1.简介

    OSS,Object Storage Service,对象存储服务。简单讲就是把文件放在云上。

    官网介绍: https://www.aliyun.com/product/oss

    2.阿里云申请与配置

    2.1 创建AccessKey

    图2-1 创建accessKey

    2.2 创建OSS的bucket

    bucket是虚拟目录,起到nameSpace的作用。

    图2-2 创建bucket

    3.安装客户端

    3.1 python

    去python.org自行下载。

    3.2 OSScmd SDK

    去阿里云下载,地址:  https://help.aliyun.com/document_detail/32026.html?spm=5176.doc32013.6.228.hFcfPv

    3.3 客户端配置

    //config client python osscmd config --host=oss-cn-shanghai.aliyuncs.com --id={access key} --key={key secret}

    4.使用示例

    4.1 console 控制台

    //see files python osscmd ls oss://wca-bucket/ //upload python osscmd put /d/code/hello.txt oss://wca-bucket/ //download python osscmd get oss://wca-bucket/hello.txt /d/code/hello.txt

    更多命令可见: https://help.aliyun.com/document_detail/32187.html

    4.2 web 控制台

    也可以在portal上查看操作结果,见图4-1。

    图4-1 web控制台

    最新回复(0)