aws s3 lsUses the high-level S3 command set for quick interactive workflows.
High-level and low-level AWS CLI S3 commands for buckets, objects, sync, versioning, encryption, and presigned URLs.
Fast object and bucket workflows using `aws s3`.
aws s3 lsUses the high-level S3 command set for quick interactive workflows.
aws s3 ls s3://my-bucket/Useful for quick manual inspection of bucket contents.
aws s3 cp ./app.log s3://my-bucket/logs/app.logThe high-level `cp` command is convenient for common transfers.
aws s3 cp s3://my-bucket/backups/db.dump ./db.dumpDownloads a single object to a local path.
aws s3 cp ./dist s3://my-bucket/site/ --recursiveFrequently used for static site and artifact uploads.
aws s3 sync ./public s3://my-bucket/public/Sync compares source and destination to transfer only needed changes.
Delete extra destination objects during sync.
aws s3 sync ./public s3://my-bucket/public/ --deleteBe careful: removes destination objects that do not exist locally.
aws s3 rm s3://my-bucket/tmp/data.csvDeletes the specified object key.
aws s3 rm s3://my-bucket/tmp/ --recursiveUseful for cleanup tasks and invalidating temp output.
aws s3 mv s3://my-bucket/tmp/file.txt s3://my-bucket/archive/file.txtUnder the hood this is effectively copy plus delete.
Low-level bucket management with `aws s3api`.
aws s3api create-bucket --bucket my-bucket --region us-west-2 --create-bucket-configuration LocationConstraint=us-west-2Use `s3api` when you need explicit API-level control.
aws s3api head-bucket --bucket my-bucketCommon in scripts that verify access or existence.
aws s3api get-bucket-location --bucket my-bucketUseful when troubleshooting region mismatch issues.
aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=EnabledVersioning protects against accidental overwrites and deletes.
Inspect the versioning configuration on a bucket.
aws s3api get-bucket-versioning --bucket my-bucketUse this to confirm whether versioning is enabled or suspended.
aws s3api put-bucket-encryption --bucket my-bucket --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'Sets default encryption so new uploads inherit the policy automatically.
Read the default encryption settings on a bucket.
aws s3api get-bucket-encryption --bucket my-bucketUseful in compliance and audit scripts.
aws s3api put-public-access-block --bucket my-bucket --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=trueCommon baseline security setting for private buckets.
aws s3api put-bucket-policy --bucket my-bucket --policy file://bucket-policy.jsonUse policy files for maintainable, reviewable access control.
aws s3api delete-bucket --bucket my-bucketThe bucket must be empty before deletion succeeds.
Low-level object inspection and manipulation.
Put a single object using low-level API options.
aws s3api put-object --bucket my-bucket --key docs/readme.txt --body ./README.mdUseful when you need API-level options not exposed in high-level `aws s3` commands.
aws s3api get-object --bucket my-bucket --key backups/db.dump ./db.dumpCan expose metadata and range options in low-level workflows.
aws s3api head-object --bucket my-bucket --key backups/db.dumpA very common way to confirm size, etag, storage class, and metadata.
aws s3api copy-object --bucket my-bucket --copy-source source-bucket/path/file.txt --key copies/file.txtUseful when you need metadata directives or encryption options.
aws s3api delete-object --bucket my-bucket --key tmp/file.txtUseful in scripts that already use low-level S3 API commands.
aws s3api list-object-versions --bucket my-bucket --prefix app/Useful when recovering or auditing previous object states.
Remove one version from a versioned bucket.
aws s3api delete-object --bucket my-bucket --key app/config.json --version-id 3Lg..exampleTargets one specific version instead of the current latest version only.
aws s3 presign s3://my-bucket/reports/monthly.pdf --expires-in 3600Useful for secure, time-limited sharing without changing bucket policies.