AWS

AWS Command-Line Interface

Date Published:
Last Modified:

S3

Listing Files

To list buckets:

$ aws s3 ls

Copying Files

$ aws s3 cp <source> <destination>
# Copy local file to S3
$ aws s3 cp my_file.txt s3://&lt;my_bucket&gt;/&lt;my_prefix&gt;

# Copy file from S3 to local
$ aws s3 cp s3://&lt;my_bucket&gt;/&lt;my_prefix&gt; my_file.txt

Syncing Files

Syncing can copy a group of files which all share a similar prefix (or part of a prefix), so you can treat the prefixes almost like directories in this case.

$ aws s3 sync <source> <destination>
# Sync all objects with the prefix "my_prefix/" to the current directory 
$ aws s3 sync s3://my_bucket/my_prefix/ ./

Like this page? Upvote with shurikens!

Related Content:

Tags:

comments powered by Disqus