s3 is a command-line utility for performing common S3 operations from your terminal.
It’s a hard fork of s3-cli, inspired by s3cmd, and aims to be a practical drop-in replacement for many everyday workflows.
- Compatible with
s3cmd’s config file format - Supports a subset of
s3cmdcommands and flags, including:put,get,del,ls,sync,cp- smarter path handling for
get/put/cp(copy to/from S3, and S3↔S3)
- Faster directory syncs by uploading multiple files in parallel (better bandwidth utilization)
- Multipart uploads for large files, with parallel part uploads (via the SDK’s S3 manager)
- More efficient CPU and local resource usage
Download a binary from the GitHub Releases page.
s3 supports both s3cmd-style config files (.s3cfg / ~/.s3cfg) and the standard AWS shared config files (~/.aws/config and ~/.aws/credentials).
The .s3cfg / ~/.s3cfg file is an INI file with one or more sections. Credentials and settings are loaded from the selected section (profile). If no profile is specified, s3 uses the [default] section.
Example ~/.s3cfg:
[default]
access_key = foo
secret_key = bar
[profile1]
access_key = foo1
secret_key = bar1Select a profile via CLI:
s3 --profile profile1 cp file1 s3://bucket/file1
s3 -p profile1 cp file1 s3://bucket/file1Or via environment variable:
AWS_PROFILE=profile1 s3 cp file1 s3://bucket/file1If you do not pass --config, s3 will try config files in this order:
./.s3cfg(current working directory), if present~/.s3cfg
To use a different config file path explicitly:
s3 --config /path/to/s3cmd.conf ...If credentials are not provided via ~/.s3cfg and not provided via environment variables, s3 falls back to the AWS SDK’s standard credential and config resolution (including ~/.aws/config, ~/.aws/credentials, and AWS_PROFILE).
You can override the AWS region used for requests with --region (or AWS_REGION / AWS_DEFAULT_REGION):
s3 --region us-east-1 ls
AWS_REGION=us-east-1 s3 lsWhen using a custom --endpoint, the client does not attempt AWS bucket region discovery.
In general, command flags and behavior are guided by rsync and common Unix CLI conventions.
You can override the S3 endpoint used for requests with --endpoint / -e (useful for S3-compatible servers like MinIO):
s3 --endpoint https://custom-s3.example.com cp file1 s3://bucket/file1
s3 -e https://custom-s3.example.com cp file1 s3://bucket/file1Notes:
s3uses path-style bucket addressing for S3 connections.- If you don’t provide explicit credentials in
.s3cfg/~/.s3cfg(or via--access-key/--secret-key), the AWS SDK credential chain may be used (including~/.aws/credentials/~/.aws/config). When talking to a non-AWS endpoint, you typically want credentials that exist on that server.
Copy files to and from S3.
Examples:
s3 cp /path/to/file s3://bucket/key/on/s3
s3 cp s3://bucket/key/on/s3 /path/to/file
s3 cp s3://bucket/key/on/s3 s3://another-bucket/some/thingDownload a file from S3 (alias for cp).
Upload a file to S3 (alias for cp).
Delete an object or a “directory” prefix on S3.
Example:
s3 del [--recursive] s3://bucket/key/on/s3/Alias for del.
s3 rm [--recursive] s3://bucket/key/on/s3/Sync between a local directory and S3.
s3 sync [--delete-removed] /path/to/folder/ s3://bucket/key/on/s3/Move an object already stored in S3.
Example:
s3 mv s3://sourcebucket/source/key s3://destbucket/dest/keys3cmd mb s3://BUCKETs3cmd rb s3://BUCKETs3cmd ls [s3://BUCKET[/PREFIX]]s3cmd las3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]s3cmd get s3://BUCKET/OBJECT LOCAL_FILEs3cmd del s3://BUCKET/OBJECTs3cmd rm s3://BUCKET/OBJECTs3cmd du [s3://BUCKET[/PREFIX]]s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]s3cmd modify s3://BUCKET1/OBJECTs3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX]ors3cmd sync s3://BUCKET[/PREFIX] LOCAL_DIRs3cmd info s3://BUCKET[/OBJECT]
s3cmd restore s3://BUCKET/OBJECTs3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]s3cmd setacl s3://BUCKET[/OBJECT]s3cmd setpolicy FILE s3://BUCKETs3cmd delpolicy s3://BUCKETs3cmd setcors FILE s3://BUCKETs3cmd delcors s3://BUCKETs3cmd payer s3://BUCKETs3cmd multipart s3://BUCKET [Id]s3cmd abortmp s3://BUCKET/OBJECT Ids3cmd listmp s3://BUCKET/OBJECT Ids3cmd accesslog s3://BUCKETs3cmd sign STRING-TO-SIGNs3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset>s3cmd fixbucket s3://BUCKET[/PREFIX]s3cmd ws-create s3://BUCKETs3cmd ws-delete s3://BUCKETs3cmd ws-info s3://BUCKETs3cmd expire s3://BUCKETs3cmd setlifecycle FILE s3://BUCKETs3cmd dellifecycle s3://BUCKETs3cmd cflists3cmd cfinfo [cf://DIST_ID]s3cmd cfcreate s3://BUCKETs3cmd cfdelete cf://DIST_IDs3cmd cfmodify cf://DIST_IDs3cmd cfinvalinfo cf://DIST_ID[/INVAL_ID]