brew install awscli
aws configure

Basic commands

List all buckets

aws s3 ls

Make a new bucket

aws s3 s3://mybucket --region us-west-1

Delete a bucket

aws s3 rb s3://mybucket --force

Copy a file from Local to s3

aws s3 cp ./test.txt s3://mybucket/test.txt

Copy a file from s3 to s3

aws s3 cp s3://mybucket/test.txt s3://mybucket/test2.txt

Copy a file from s3 to Local

aws s3 cp s3://mybucket/test.txt ./test.txt

Copy all files from s3 within a bucket to Local

aws s3 cp s3://mybucket . --recursive

Copy all files from Local to s3 bucket

aws s3 cp myDir s3://mybucket/ --recursive --exclude "*.gif" --acl public-read

Sync from a bucket to another bucket

aws s3 sync s3://mybucket s3://mybucket2 --acl public-read

I also alias aws s3 to just s3, so my command looks something like s3 ls, s3 cp, s3 mb, etc. 😉

Reference: Aws S3