---
title: How to install S3cmd and command to use s3cmd
description: How to install S3cmd and command to use s3cmd
---

[![e-Zest logo\_An accion lab company\_Colour](https://blog.e-zest.com/hubfs/images/Logos%20with%20Tagline/Corporate/SVG/e-Zest%20logo_An%20accion%20lab%20company_Colour.svg "e-Zest logo_An accion lab company_Colour")](https://www.e-zest.com/)

- [WORK](https://www.e-zest.com/our-work)
- [SERVICES](https://www.e-zest.com/our-services) 
    - [Product Engineering](https://www.e-zest.com/digital-product-engineering-services)
    - [Enterprise Data Services](https://www.e-zest.com/enterprise-data-services)
    - [Digital Commerce](https://www.e-zest.com/digital-commerce-services)
    - [Digital Operations](https://www.e-zest.com/digital-operations)
    - [Digital Consulting](https://www.e-zest.com/digital-transformation-consulting-services)
    - [Digital Experience Design](https://www.e-zest.com/digital-experience-design)
- [INSIGHTS](https://blog.e-zest.com/)
- [CAREERS](https://www.e-zest.com/careers)
- [ENTERPRISE DATA SERVICES](https://www.e-zest.com/enterprise-data-services)
- [GENERATIVE AI](https://www.e-zest.com/generative-ai)
- [Healthcare](https://healthcare.e-zest.com)
- [Contact Us](https://www.e-zest.com/contact-us)

- ![Elevating Product Engineering with AI and ML](https://blog.e-zest.com/hubfs/Elevating%20Product%20Engineering%20with%20AI%20and%20ML.jpg)

  [BLOGS](https://blog.e-zest.com)
  
  #### Elevating Product Engineering with AI and ML

  As technology evolves and customer choices broaden, there is an increasing ...

  [Read more](https://blog.e-zest.com/elevating-product-engineering-with-ai-and-ml)
- ![e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024](https://blog.e-zest.com/hubfs/e-Zest%20%E2%80%93%20An%20Accion%20Labs%20Company%20-%20Gets%20Recognition%20as%20a%20Contender%20in%20the%20ISG%20Provider%20LensTM%20Study%20on%20Digital%20Engineering%20Services%202024.jpg)

  [NEWS](https://blog.e-zest.com/news)
  
  #### e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024

  We are delighted to announce that e-Zest – An Accion Labs Company has been ...

  [Read more](https://blog.e-zest.com/news/e-zest-an-accion-labs-company-gets-recognition-as-a-contender-in-the-isg-provider-lens-study-on-digital-engineering-services-2024)
- ![e-Zest Solutions supports Digital Pune Mission](https://blog.e-zest.com/hubfs/blog-files/Digital%20Literacy%20Bus%20e-Zest.png)

  [CSR](https://blog.e-zest.com/csr)
  
  #### e-Zest Solutions supports Digital Pune Mission

  **Pune, India:** e-Zest Solutions, a leading digital technology innovation ...

  [Read more](https://blog.e-zest.com/csr/e-zest-solutions-supports-digital-pune-mission)

- [Work](https://www.e-zest.com/our-work)
- [Services](https://www.e-zest.com/our-services)
- [Insights](https://blog.e-zest.com)
- [Careers](https://www.e-zest.com/careers)
- [Enterprise Data](https://www.e-zest.com/enterprise-data-services)
- [Generative AI](https://www.e-zest.com/generative-ai)
- [Innovations](https://www.e-zest.com/innovations)
- [Healthcare](https://healthcare.e-zest.com)
- [About](https://www.e-zest.com/about-us)
- [Contact](https://www.e-zest.com/contact-us)

- [Blog](https://blog.e-zest.com/)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)

- [![Linkedin Icon](https://blog.e-zest.com/hubfs/icons/linkedin_icon_white.svg)](https://www.linkedin.com/company/e-zest-solutions/)
- [![Twitter Icon](https://blog.e-zest.com/hubfs/twitter-logo-silhouette%20(5).svg)](https://twitter.com/ezest)
- [![Facebook Icon](https://blog.e-zest.com/hubfs/facebook-app-logo%20(4).svg)](https://www.facebook.com/61259256638)
- [![Instagram Icon](https://blog.e-zest.com/hubfs/instagram-logo%20(4).svg)](https://www.instagram.com/ezestsolutions/)
- [![Youtube Icon](https://blog.e-zest.com/hubfs/icons/youtube_icon_white.svg)](https://www.youtube.com/user/ezestcorporate)

[![Go to top icon](https://blog.e-zest.com/hubfs/AA%20Assets/top%20button.svg)](https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/#top)

Hit enter to search or ESC to close

Insights

e-Zest members share technology ideas to foster digital transformation.

- [Blog](https://blog.e-zest.com)
- [News](https://blog.e-zest.com/news)
- [Podcasts](https://www.e-zest.com/podcasts)
- [Healthcare](https://blog.e-zest.com/healthcare)
- [CSR](https://blog.e-zest.com/csr)
- [Whitepaper](https://blog.e-zest.com/whitepaper)
- [Playbook](https://blog.e-zest.com/playbook)
- [Media Kit](https://www.e-zest.com/media-kit)

# How to install S3cmd and command to use s3cmd

[Priya Benade](https://blog.e-zest.com/author/priya-benade)  Mar 03, 2015

[Technology](https://blog.e-zest.com/topic/technology)

- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/&title=&summary=&source=>
- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/&text=How%20to%20install%20S3cmd%20and%20command%20to%20use%20s3cmd>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/>
- <https://www.instagram.com/ezestsolutions/?u=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/>

**s3cmd** is a command line utility used for creating s3 buckets, uploading, retrieving and managing data to Amazon s3 storage. Let’s see how to use install **s3cmd** and manage s3 buckets via command line in easy steps.

***Follow the steps below to install S3cmd tool :***

1. wget http://sourceforge.net/projects/s3tools/files/s3cmd/1.5.0-alpha1/s3cmd-1.5.0-alpha1.tar.gz
2. tar -xvzf s3cmd-1.5.0-alpha1.tar.gz
3. cd s3cmd-1.5.0-alpha1
4. python setup.py install
5. yum install python-magic
6. cd
7. s3cmd --configure

***Commands:***

**1) To list all the buckets from s3**

S3cmd ls

**2) Create the bucket**

\[root@localhost ~\]# s3cmd mb s3://priyaTest

Bucket 's3://priyaTest/' created

**3) To list the bucket content**

\[root@localhost ~\]# s3cmd ls s3://priyaTest/

2014-01-24 13:22 35 s3://priyaTest/S3put.txt

**4) To put the single file into the s3**

\[root@localhost ~\]# s3cmd put S3put.txt s3://priyaTest/

S3put.txt -\> s3://priyaTest/S3put.txt \[1 of 1\]

35 of 35 100% in 0s 45.55 B/s done

**5) Get the uploaded file from the s3 and verify that its hasn't been corrupted.**

\[root@localhost ~\]# s3cmd get s3://priyaTest/S3put.txt S3put\_1.txt

s3://priyaTest/S3put.txt -\> S3put\_1.txt \[1 of 1\]

35 of 35 100% in 2s 13.68 B/s done

**Now there are two files:**

\[root@localhost ~\]# ls -l | grep S3put

-rw-r--r--. 1 root root 35 Jan 28 20:42 S3put\_1.txt

-rw-r--r--. 1 root root 35 Jan 24 05:20 S3put.txt

**Check the file corruption:**

\[root@localhost ~\]# md5sum S3put.txt S3put\_1.txt

d15116439e554bfebe1355f969aa51d0 S3put.txt

d15116439e554bfebe1355f969aa51d0 S3put\_1.txt

If Checksums of the original file matches with the retrieved one, then verification is successfully done (i.e. file is not corrupt).

**6) Delete objects and bucket.**

If any object is present into the bucket then bucket will not be deleted. Before deleting the bucket, clean up the objects which are present in that bucket.

\[root@localhost ~\]# s3cmd del s3://priyaTest/S3put.txt

File s3://priyaTest/S3put.txt deleted

\[root@localhost ~\]# s3cmd ls s3://priyaTest/

\[root@localhost ~\]#

\[root@localhost ~\]# s3cmd rb s3://priyaTest/

Bucket 's3://priyaTest/' removed

\[root@localhost ~\]#

**7) To upload multiple files on s3**

\[root@localhost home\]# s3cmd put -r Priya s3://priyaTest/

Priya/p4 -\> s3://priyaTest/Priya/p4 \[1 of 3\]

11 of 11 100% in 3s 3.52 B/s done

Priya/priya -\> s3://priyaTest/Priya/priya \[2 of 3\]

3 of 3 100% in 1s 2.84 B/s done

Priya/sync.txt -\> s3://priyaTest/Priya/sync.txt \[3 of 3\]

35 of 35 100% in 0s 49.57 B/s done

**OR**

\[root@localhost home\]# s3cmd put --recursive Priya s3://priyaTest/

Priya/p4 -\> s3://priyaTest/Priya/p4 \[1 of 3\]

11 of 11 100% in 2s 4.07 B/s done

Priya/priya -\> s3://priyaTest/Priya/priya \[2 of 3\]

3 of 3 100% in 0s 4.14 B/s done

Priya/sync.txt -\> s3://priyaTest/Priya/sync.txt \[3 of 3\]

35 of 35 100% in 0s 48.77 B/s done

\[root@localhost home\]#

**8) S3cmd Sync**

The files which do not exist in the destination in the same version are uploaded only by the s3cmd sync command. File size and md5checksum is performed by default. Sync checkst the details of files already present at the destination first and compares them with local files. It checks for md5 checksum or file size and then uploads the files which are different.

To test s3cmd create one new file as:

root@localhost Priya\]# pwd

/home/Priya

\[root@localhost Priya\]# touch newtest.txt

\[root@localhost Priya\]# ll

total 12

-rw-r--r--. 1 root root 0 Feb 4 20:58 newtest.txt

-rw-r--r--. 1 root root 11 Jan 30 21:08 p4

-rw-r--r--. 1 root root 3 Jan 30 21:07 priya

-rw-r--r--. 1 root root 35 Jan 30 21:27 sync.txt

\[root@localhost Priya\]#

**By using s3cmd sync**

\[root@localhost Priya\]# s3cmd sync /home/Priya/ s3://priyaTest/

/home/Priya/newtest.txt -\> s3://priyaTest/newtest.txt \[1 of 1\]

0 of 0 0% in 0s 0.00 B/s done

\[root@localhost Priya\]#

**Dry run command of s3cmd command:**

If you want to find out which files will be uploaded into the s3, then we can use s3cmd sync --dry-run

\[root@localhost Priya\]# vim newtest.txt

\[root@localhost Priya\]# s3cmd sync --dry-run /home/Priya/ s3://priyaTest/

upload: /home/Priya/newtest.txt -\> s3://priyaTest/newtest.txt

**WARNING**: Exiting now because of --dry-run

**And —delete-removed** is used to get a list of files that exist remotely but are no longer present locally (or perhaps just have different names here):

\[root@localhost Priya\]# s3cmd sync --dry-run --delete-removed /home/Priya/ s3://priyaTest/

delete: s3://priyaTest/dsfsd/

delete: s3://priyaTest/newtest.txt

WARNING: Exitting now because of --dry-run

\[root@localhost Priya\]#

Download from S3

To download from s3, use get command.

\[root@localhost home\]# s3cmd get -r s3://priyaTest/ /home/

s3://priyaTest/newtest.txt -\> /home/newtest.txt \[1 of 4\]

0 of 0 0% in 0s 0.00 B/s done

s3://priyaTest/p4 -\> /home/p4 \[2 of 4\]

11 of 11 100% in 0s 25.01 B/s done

s3://priyaTest/priya -\> /home/priya \[3 of 4\]

3 of 3 100% in 0s 6.73 B/s done

s3://priyaTest/sync.txt -\> /home/sync.txt \[4 of 4\]

35 of 35 100% in 0s 75.17 B/s done

\[root@localhost home\]# ll

total 12

-rw-r--r--. 1 root root 0 Feb 6 04:16 newtest.txt

-rw-r--r--. 1 root root 11 Feb 6 04:16 p4

-rw-r--r--. 1 root root 3 Feb 6 04:16 priya

-rw-r--r--. 1 root root 35 Feb 6 04:16 sync.txt

\[root@localhost home\]#

Use –exclude command – to exclude as per requirement during download.

\[root@localhost home\]# s3cmd get --force --recursive s3://priyaTest/ --exclude p\* /home/

s3://priyaTest/newtest.txt -\> /home/newtest.txt \[1 of 2\]

0 of 0 0% in 0s 0.00 B/s done

s3://priyaTest/sync.txt -\> /home/sync.txt \[2 of 2\]

35 of 35 100% in 0s 77.68 B/s done

\[root@localhost home\]#s3cmd sync --dry-run --exclude '\*.txt' --include 'dir2/\*' . s3://s3tools-demo/demo/

exclude: dir1/file1-1.txt

exclude: dir1/file1-2.txt

exclude: file0-2.txt

upload: ./dir2/file2-1.log -\> s3://s3tools-demo/demo/dir2/file2-1.log

upload: ./dir2/file2-2.txt -\> s3://s3tools-demo/demo/dir2/file2-2.txt

upload: ./file0-1.msg -\> s3://s3tools-demo/demo/file0-1.msg

upload: ./file0-3.log -\> s3://s3tools-demo/demo/file0-3.log

WARNING: Exiting now because of --dry-run

The line in bold shows a file that has a ,txt extension, ie matches an exclude pattern, but because it also matches the ‘dir2/\*’ include pattern, it is still scheduled for upload.

*Do let me know if you found this blog helpful. You can share your thoughts in the comments below.*

- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/&text=How%20to%20install%20S3cmd%20and%20command%20to%20use%20s3cmd>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/how-to-install-s3cmd-and-command-to-use-s3cmd/&title=&summary=&source=>

### Similar Blog

[![Managing a New Job in the Pandemic](https://blog.e-zest.com/hubfs/Managing%20a%20New%20Job2.jpg) Managing a New Job in the Pandemic A new job and a pandemic, well this has been my story so far. A recent graduate from Pune University, I was really happy when I ... By Sumedh Pathak Jun 01, 2020](https://blog.e-zest.com/managing-a-new-job-in-the-pandemic)

[![12 Technology Trends to watch for in 2020](https://blog.e-zest.com/hubfs/Technology%20Trends%202020-200108.png) 12 Technology Trends to watch for in 2020 Technology has evolved at an unimaginable pace in the last decade: what seemed futuristic and impossible until a few years ago is ... By Devendra Deshmukh Jan 10, 2020](https://blog.e-zest.com/12-technology-trends-to-watch-for-in-2020)

[![Horizon 2020: How technology is influencing human lives, and its impact on organizations](https://blog.e-zest.com/hubfs/blog-files/Horizon%202020_%20How%20technology%20is%20influencing%20human%20lives%2c%20and%20it%E2%80%99s%20impact%20on%20organisations.png) Horizon 2020: How technology is influencing human lives, and its impact on organizations As we step into a new decade, technologies across the board, from AI to cryptocurrency and online shopping are changing. We are ... By Devendra Deshmukh Dec 12, 2019](https://blog.e-zest.com/horizon-2020-how-technology-is-influencing-human-lives-and-its-impact-on-organisations)

[![5 core elements of a Design Checklist!](https://blog.e-zest.com/hubfs/blog-files/5%20Core%20Elements%20for%20A%20Design%20Checklist.png) 5 core elements of a Design Checklist! Every design project is unique, and every project has its unique outcomes based on what eventual customer experience we are ... By Corporate Jul 10, 2019](https://blog.e-zest.com/5-core-elements-of-a-design-checklist)

[![Installing Kubernetes cluster on Ubuntu 16.04](https://blog.e-zest.com/hubfs/blog-files/azure-devops.png) Installing Kubernetes cluster on Ubuntu 16.04 **Introduction:**Use of containers for deploying applications and micro-services has been a common practice widely. Orchestration of ... By Nikhil Garge Jun 26, 2019](https://blog.e-zest.com/installing-kubernetes-cluster-on-ubuntu)

[![Installation of SVN](https://blog.e-zest.com/hubfs/Svn%201.png) Installation of SVN Subversion is software which help developers to work together and to maintain complete work history. Developers can modify, add ... By Priya Benade Mar 02, 2017](https://blog.e-zest.com/installation-of-svn)

[SSL installation in Tomcat **How to generate a CSR in Tomcat** By Priya Benade Dec 23, 2015](https://blog.e-zest.com/ssl-installation-in-tomcat)

[![How to add SSH users in Amazon Linux](https://blog.e-zest.com/hs-fs/file-3586007745-jpg/blog-files/add-ssh-users-in-amazon-linux.jpg) How to add SSH users in Amazon Linux **What Is SSH?** By Priya Benade May 20, 2013](https://blog.e-zest.com/how-to-add-ssh-users-in-amazon-linux/)

## Helping Organizations Thrive in the Digital Age

[Contact Us](https://www.e-zest.com/contact-us)

- [About](https://www.e-zest.com/about-us)
- [Services](https://www.e-zest.com/our-services)
- [Work](https://www.e-zest.com/our-work)
- [Insights](https://blog.e-zest.com/)
- [Healthcare](https://healthcare.e-zest.com/)
- [Accion Labs](https://www.accionlabs.com/)

- <https://www.linkedin.com/company/e-zest-solutions/>
- <https://twitter.com/ezest>
- <https://www.facebook.com/eZest/>
- <https://www.instagram.com/ezestsolutions/>
- <https://www.youtube.com/user/ezestcorporate>

- Dallas
- Detroit
- Hannover
- Vienna
- London
- Pune

 © 2025 e-Zest Solutions

- [Privacy Policy](https://www.e-zest.com/privacypolicy)
- [Cookie Policy](https://www.e-zest.com/cookie-policy)

 Contact us

 Contact us

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.