s3cmd command line tool
S3cmd is a free command line tool. It allows you to upload and download your data to the S3 object storage. S3cmd is written in Python. S3cmd is an open-source project available under GNU Public License v2 (GPLv2) and it is free for personal as well as commercial usage.
We recommend you use preferably AWS CLI. We encountered some issues while using s3cmd. For instance, bucket names cannot begin with numbers or capital letters.
Installation of s3cmd tool
S3cmd is available in the system repositories for CentOS, RHEL and Ubuntu. You can install it via following guide.
On CentOS/RHEL
On Ubuntu/Debian
Configuration of s3cmd tool
Please insert the following lines into the config file located at /home/user/.s3cfg.
host_base
and host_bucket
is S3 endpoint URL, which you received via email together with access_key
and secret_key
. You should receive it via email during the S3 account creation.
Config file with GPG encryption
Basic s3cmd commands
S3cmd commands support elementary operations with buckets - creation, listing, and deletion.
Bucket operations
Bucket name
The bucket name should be unique within tenant and should contain only small letters, capital letters, numerals, dashes, and dots. The bucket name must begin only with a letter or numeral and it cannot contain dots next to dashes or multiple dots.
Listing all s3 buckets
Creation of new s3 bucket
Removing s3 bucket
Only emptied bucket can be removed!
Listing s3 bucket size
Files and directories operation
Listing of s3 bucket
File upload
Upload of encrypted files
Directory upload
Please make sure, that you didn’t forget to remove the trailing slash (e.g. .: directory/), trailing slash denotes uploading only the content of the desired directory.
Download file from s3 bucket
Data deletion from s3 bucket
Data sync into s3 bucket from local machine
Data sync from s3 bucket to local machine
Last updated on