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]Code language: JavaScript (javascript)I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals
This blog gives a clear and practical introduction to AWS S3 commands with useful examples. I like how it explains basic operations like creating buckets, uploading files, and managing data in a simple way. Itโs a helpful read for beginners who want to understand S3 using the AWS CLI.