Jump to content

AWS Tutorials: AWS S3 Commands Example


Recommended Posts


List Buckets: To list all your S3 buckets.
aws s3 ls

List Objects in a Bucket: To list all objects in a specific bucket.
aws s3 ls s3://[bucket-name]/

Create a New Bucket: To create a new S3 bucket.
aws s3 mb s3://[bucket-name]

Delete a Bucket: To delete an S3 bucket. The bucket must be empty before it can be deleted.
aws s3 rb s3://[bucket-name]

Upload File to Bucket: To upload a file to an S3 bucket.
aws s3 cp [file-name] s3://[bucket-name]/[destination-path]

Download File from Bucket: To download a file from an S3 bucket.
aws s3 cp s3://[bucket-name]/[file-name] [local-destination-path]

Delete File from Bucket: To delete a file from an S3 bucket.
aws s3 rm s3://[bucket-name]/[file-name]

Sync Local Directory with Bucket: To synchronize the contents of a local directory with an S3 bucket.
aws s3 sync [local-directory-path] s3://[bucket-name]

Sync Bucket with Local Directory: To synchronize the contents of an S3 bucket with a local directory.
aws s3 sync s3://[bucket-name] [local-directory-path]

Move File: To move a file from one S3 location to another.
aws s3 mv s3://[bucket-name]/[source-file-name] s3://[bucket-name]/[destination-file-name]

The post AWS Tutorials: AWS S3 Commands Example appeared first on DevOpsSchool.com.

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...