Commands

  aws s3 ls                           # List all buckets
  aws s3 ls s3://<bucket>             # List content of a bucket
  aws s3 ls s3://<bucket>/<path>/     # Trailing '/' to list directory content
  aws s3 ls --recursive s3://<bucket>/<path>
  
  aws s3 mb s3://<bucket>             # Create a bucket
  
  aws s3 cp <path> s3://<bucket>      # Copy into bucket
  aws s3 cp s3://<bucket> <path>      # Copy from bucket
  
  aws mv s3://<bucket>/<src> <dest>   # Move within bucket
  
  aws s3 rb s3://<bucket>             # Remove empty bucket
  aws s3 rm s3://<bucket>/<path>      # Remove object from bucket
  aws s3 rm --recursive s3://<bucket>/<path>   # Drop all in <path>

Copy Bucket to Bucket

  aws s3 sync s3://bucket-1 s3://bucket-2

Typical env vars

export AWS_ACCESS_KEY_ID=abc
export AWS_SECRET_ACCESS_KEY=def
export AWS_ENDPOINT_URL=https://yourserver.com:12345