zoukankan      html  css  js  c++  java
  • aws cli command line interface的安装与使用

    安装

    在centos中安装aws cli,安装依赖python,先装好python,然后按下述命令执行

    yum install wget
    wget https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
    pip install awscli

    配置

    在使用之前需要配置自己的key ID及 Access Key,执行aws configure,一步步配置如下:

    AWS Access Key ID [None]: AKIAI44QH8DHBEXAMPLE 
    AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY 
    Default region name [None]: us-east-1 
    Default output format [None]: text

    使用

    使用一般要加上自己的文件存储地址,即endpoint,否则会去默认的url去找,找不到

    1)查看所有的bucket 
    aws --endpoint-url http://shbt.s3.xx s3 ls
    2)查看某个bucket下的文件
    aws --endpoint-url http://shbt.s3.xx s3 ls s3://mobiledict
    3)上传单个文件
    aws --endpoint-url http://shbt.s3.xx s3 cp /home/yangjiao/m.txt s3://mobiledict
    4)批量上传文件,即上传文件夹
    aws --endpoint-url http://shbt.s3.xx s3 cp myfolder s3://mybucket/myfolder --recursive
    5)创建bucket
    aws --endpoint-url http://shbt.s3.xx s3 mb s3://mybucket
    6)删除bucket
    aws --endpoint-url http://shbt.s3.xx s3 rm s3://mybucket/m.txt

    参考文档:https://docs.minio.io/docs/aws-cli-with-minio

    https://blog.csdn.net/libing_thinking/article/details/48091743

    https://aws.amazon.com/cn/cli/

    https://docs.aws.amazon.com/zh_cn/cli/latest/userguide/cli-chap-welcome.html

  • 相关阅读:
    ajax 笔记
    EM Algorithm
    Support Vector Machine
    Factor Analysis
    Local weighted regression
    一点突发奇想
    纳什均衡
    自驾崇明东滩湿地
    程序员热力学第二定律
    SQL Server Identity 属性的问题
  • 原文地址:https://www.cnblogs.com/kumufengchun/p/9968494.html
Copyright © 2011-2022 走看看