s3cmd
TLDR
Configure s3cmd (interactive setup)
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 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 usage--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
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.


