当前位置:   article > 正文

Linux 使用亚马逊AWS 命令行界面 (CLI)_awscli官方文档

awscli官方文档

目录

AWS 命令行界面 (CLI) 官方文档

1.Linux 平台安装 AWS CLI

2.Linux 配置 AWS CLI

3.Linux 使用AWS-CLI下载亚马逊 S3的多个目标


AWS 命令行界面 (CLI) 官方文档

What is the AWS Command Line Interface? - AWS Command Line Interface

1.Linux 平台安装 AWS CLI

  1. #下载安装文件
  2. curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
  3. #解压安装文件
  4. unzip awscliv2.zip
  5. #默认安装路径
  6. /home/xxx/Tools/AWS_CLI/2023.11
  7. #指定安装路径
  8. ./aws/install -i /home/xxx/Tools/AWS_CLI/2023.11 -b /home/xxx/Tools/AWS_CLI/2023.11
  9. ##--install-dir or -i – This option specifies the directory to copy all of the files to.
  10. ##--bin-dir or -b – This option specifies that the main aws program in the install directory is symbolically linked to the file aws in the specified path.
  11. ## You must have write permissions to the specified directory.
  12. ## Creating a symlink to a directory that is already in your path eliminates the need to add the install directory to the user's $PATH variable.

2.Linux 配置 AWS CLI

  1. #在安装路径下进行配置
  2. ./aws configure
  3. #配置完成后,可知/home/.aws/目录下查看配置文件

注意事项:

配置时,需创建用户

3.Linux 使用AWS-CLI下载亚马逊 S3的多个目标

What is Amazon S3? - Amazon Simple Storage Service

The following example shows how you can use the AWS CLI to download all of the files or objects under the specified directory or prefix. This command copies all objects from the bucket DOC-EXAMPLE-BUCKET1 to your current directory. To use this example command, use your bucket name in place of DOC-EXAMPLE-BUCKET1.

aws s3 cp s3://DOC-EXAMPLE-BUCKET1 . --recursive

The following command downloads all of the objects under the prefix logs in the bucket DOC-EXAMPLE-BUCKET1 to your current directory. It also uses the --exclude and --include parameters to copy only objects with the suffix .log. To use this example command, replace the user input placeholders with your own information.

注意事项:Use of Exclude and Include Filters 

s3 — AWS CLI 2.13.34 Command Reference

  1. #使用AWS-CLI下载多个目标
  2. aws s3 cp s3://DOC-EXAMPLE-BUCKET1/logs/ . --recursive --exclude "*" --include "*.log"

  1. #AWS CLI Access (No AWS account required)
  2. aws s3 cp --no-sign-request s3://DOC-EXAMPLE-BUCKET1/logs/ . --recursive --exclude "*" --include "*.log"

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/972703
推荐阅读
相关标签
  

闽ICP备14008679号