LoginSignup
2
1

More than 5 years have passed since last update.

AWS CLI でS3へアクセスするコマンドメモ

Posted at

AWS CLIを使ったS3へのアクセスのコマンドラインの備忘録。
aws-cliのインストールとアクセスキー/シークレットキーの設定は済んでいる前提。

ディレクトリ配下のファイルを確認

$ aws s3 ls s3://mybucket1/data/test/
2015-02-04 14:43:43          0
2015-02-06 14:46:08          5 test.txt

S3のファイルをローカルにダウンロード

$ aws s3 cp s3://mybucket1/data/test/test.txt ./
download: s3://mybucket1/data/test/test.txt to ./test.txt

S3にファイルをアップロード

$ aws s3 cp ./test2.txt s3://mybucket1/data/test/
upload: ./test2.txt to s3://mybucket1/data/test/test2.txt

アップロード後されたファイルを確認

$ aws s3 ls s3://mybucket1/data/test/
2015-02-04 14:43:43          0
2015-02-06 14:46:08          5 test.txt
2015-02-06 15:00:44          5 test2.txt
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1