Quotes

Monday, November 25, 2019

AWS CLI copy files S3 to local

Copying a file to S3

$ aws s3 cp MyFile.txt s3://my-bucket/path/

Moving all files from S3

$ aws s3 mv s3://my-bucket/path ./MyDirectory --recursive

Removing a file from S3

$ aws s3 rm s3://my-bucket/path/MyFile.txt

Syncing current directory with a S3 bucket

$ aws s3 sync . s3://my-bucket/path

Delete all contents of a bucket

$ aws s3 rm s3://my-bucket/path --recursive

List all buckets

$ aws s3 ls

List contents of a bucket

$ aws s3 ls s3://bucket-name

No comments:

Post a Comment