s3cmd
Command-line tool for Amazon S3 management
TLDR
SYNOPSIS
s3cmd [options] command [parameters]
DESCRIPTION
s3cmd is a command-line tool for managing Amazon S3 and S3-compatible storage services. It provides a familiar interface for uploading, downloading, and managing files in cloud object storage.Configuration is stored in ~/.s3cfg and includes access keys, encryption settings, and default options. Run --configure for interactive setup.The sync command is particularly powerful for backups, mirroring directories to S3 while only transferring changed files. With --delete-removed, it creates exact mirrors.S3cmd supports server-side encryption, multipart uploads for large files, and can work with S3-compatible services like MinIO, DigitalOcean Spaces, and Wasabi.
PARAMETERS
ls [s3://bucket]
List buckets or objectsmb s3://bucket
Make bucketrb s3://bucket
Remove bucketput file s3://bucket/path
Upload fileget s3://bucket/path [local]
Download filedel, rm s3://bucket/path
Delete objectsync source dest
Sync directories (local to S3 or S3 to local)cp src dst
Copy objectmv src dst
Move objectinfo s3://bucket/object
Get info on bucket or objectdu [s3://bucket]
Disk usagela
List all objects in all bucketssetacl s3://bucket/object
Modify access control listsignurl s3://bucket/object expiry
Generate time-limited signed URLrestore s3://bucket/object
Restore file from Glacier storage--configure
Interactive configuration--recursive, -r
Recursive operation--delete-removed
Delete files not in source during sync--dry-run, -n
Show what would be done--acl-public
Make uploaded files public--acl-private
Make uploaded files private--exclude pattern
Exclude files matching pattern--include pattern
Include files matching pattern--storage-class CLASS
Set storage class (STANDARD, GLACIER, DEEP_ARCHIVE, etc.)--server-side-encryption
Use S3-managed server-side encryption--skip-existing
Skip files that already exist at destination--verbose, -v
Enable verbose output--limit-rate RATE
Throttle upload/download speed--config FILE
Use specified config file instead of ~/.s3cfg
CAVEATS
AWS credentials in ~/.s3cfg should have restricted permissions (600). Never commit credentials to version control.Sync operations compare by size and modification time by default. Use --check-md5 for checksum verification at the cost of speed.Large file uploads automatically use multipart upload. For very large files, increase --multipart-chunk-size-mb.Bucket names must be globally unique across all AWS accounts and follow DNS naming conventions.
