aws-s3-cp
TLDR
Copy a local file to an S3 bucket
SYNOPSIS
aws s3 cp source destination [options]
DESCRIPTION
aws s3 cp copies files between the local filesystem and Amazon S3, or between S3 locations. The source and destination can be a LocalPath (local file/directory) or an S3Uri (s3://bucket-name/key).
The command supports single file transfers, recursive directory copies, and streaming data to/from S3. It handles multipart uploads automatically for large files and can preserve or modify object metadata during copies.
PARAMETERS
--recursive
Copy all files and objects under the specified directory or S3 prefix--dryrun
Display operations that would be performed without executing them--quiet
Suppress all output during the copy operation--include pattern
Include files matching the pattern (used with --exclude)--exclude pattern
Exclude files matching the pattern from the copy operation--acl value
Set access control list: private, public-read, public-read-write, authenticated-read, bucket-owner-full-control--storage-class value
Specify storage class: STANDARD, REDUCEDREDUNDANCY, STANDARDIA, ONEZONEIA, INTELLIGENTTIERING, GLACIER, DEEPARCHIVE, GLACIERIR--sse value
Enable server-side encryption: AES256 or aws:kms--sse-kms-key-id value
KMS key ID for server-side encryption with AWS KMS--metadata value
Custom metadata to store with the S3 object (JSON format)--content-type value
Override the MIME type of the uploaded object--expires value
Set the Expires header (e.g., 2024-12-31T23:59:59Z)--no-overwrite
Prevent overwriting existing files at the destination--expected-size value
Expected stream size in bytes (required for streams over 50GB)--follow-symlinks / --no-follow-symlinks
Follow symbolic links when copying (default: follow)
CAVEATS
When copying directories recursively, use trailing slashes consistently to control prefix behavior. Pattern matching with --include and --exclude is order-dependent. Copying to/from Glacier storage class requires special flags (--force-glacier-transfer). Streaming operations from stdin require --expected-size for files larger than 50GB.
SEE ALSO
aws-s3(1), aws-s3-sync(1), aws-s3-mv(1), aws-s3api(1)


