1 安装 AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install
2 查看当前版本
aws --version
3 卸载
pip uninstall awscli
4 配置 AWS CLI
aws configure
5, 上传对象
aws s3 cp /test1/111.txt s3://aaaa --endpoint http://oss-cnbj01.cdsgss.com
6 访问s3: 需要输入endpoint
每次需要输入 aws s3 --endpoint http://oss-cnbj01.cdsgss.com --profile sh "$@" ls s3://
很麻烦, 可以设置为 aws-sh=aws s3 --endpoint=http://oss-cnbj01.cdsgss.com
--profile sh "$@"
之后就可以通过aws-sh ls s3://***来查看s3了.
7 其他s3命令
- aws-sh ls s3://容器名称
- aws-sh cp fileName s3://容器名称/fileName [复制文件]
- aws-sh cp --recursive filePath s3://容器名称/filePath [ 复制目录i]
- aws-sh rm s3://容器名称 删除
- 从s3获取 aws-sh cp s3://容器名称/fileName ./