Manage S3-compatible object storage using s3cmd. Use for: listing buckets/contents, uploading/downloading files, syncing directories, managing ACLs, or listing objects. Supports AWS S3 and DigitalOcean Spaces via config profiles.
When the user has multiple providers, identify which one they mean, then use
the appropriate config file with -c:
s3cmd -c ~/.s3cfg-aws <command> # AWS S3
s3cmd -c ~/.s3cfg-do <command> # DigitalOcean Spaces
If the user hasn't set up named configs yet, see references/providers.md for setup.
List buckets:
s3cmd ls
List bucket contents:
s3cmd ls s3://bucket-name/
s3cmd ls s3://bucket-name/prefix/
List all objects recursively:
s3cmd ls --recursive s3://bucket-name/
Upload a file:
s3cmd put localfile.txt s3://bucket-name/path/file.txt
Upload a directory:
s3cmd put --recursive localdir/ s3://bucket-name/path/
Download a file:
s3cmd get s3://bucket-name/path/file.txt localfile.txt
Sync local → bucket:
s3cmd sync localdir/ s3://bucket-name/path/
Sync bucket → local:
s3cmd sync s3://bucket-name/path/ localdir/
Add --delete-removed to mirror deletions. Add --dry-run to preview.
Inspect ACL / bucket info:
s3cmd info s3://bucket-name
s3cmd info s3://bucket-name/path/file.txt
Set ACL on a bucket or object:
s3cmd setacl --acl-public s3://bucket-name # public-read
s3cmd setacl --acl-private s3://bucket-name # private
s3cmd setacl --acl-public s3://bucket-name/file.txt
Apply recursively:
s3cmd setacl --acl-private --recursive s3://bucket-name/
See references/providers.md for: