awscli

My Note

  • List buckets
bash
aws s3 ls
  • List file sizes
bash
aws s3 ls s3://bucket-name/ --recursive --human-readable --summarize
  • Move select files
bash
aws s3 mv s3://bucket-name/ s3://new-bucket/ --recursive --exclude "*.jpg"
  • List files in a Bucket
bash
aws s3 ls s3://bucket-name
  • Create bucket
bash
aws s3 mb s3://bucket-name
  • Delete bucket
bash
aws s3 rb s3://bucket-name --force
  • Download s3 object
bash
aws s3 cp s3://bucket-name
  • Upload local file
bash
aws s3 cp test.txt s3://bucket-name
  • Delete s3 object
bash
aws s3 rm s3://bucket-name/test.txt
  • Download bucket to local
bash
aws s3 sync s3://bucket-name/ /tmp/