1.找到一个路径下载 aws-cli (使用离线包安装)
wget -P /usr/local/software https://s3.amazonaws.com/aws-cli/awscli-bundle.zip unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws 如果你没有sudo权限或者是你想在当前的用户权限下面安装AWS CLI则,运行下面的命令: ./awscli-bundle/install -b ~/bin/aws
aws --version
2.配置configure (依次录入 用户 密码 S3区域 )
aws configure
AWS Access Key ID [None]:
(输入AWS账户的Access key ID)
AWS Secret Access Key [None]:
(输入AWS账户的Secret access key)
Default region name [None]:
(s3所在区域,需要去后台查,比如us-west-2)
Default output format [None]:
(可以直接回车enter)
3.AWS 文件命令
1.查看Object 列表 $ aws s3 ls s3://mybucket 2.文件上传 $ aws s3 cp uploadFilePath s3://mybucket/aaa/bbb/ 3.文件夹上传(递归文件) $ aws s3 cp uploadFolderPath s3://mybucket/myfolder --recursive