Windows
1. Install s3cmd
Step 1: Check Python Installation
Ensure Python is installed by running:
python --versionIf Python is not installed, download and install it from Python Official Website.
Step 2: Upgrade pip
Run the following command to upgrade pip:
python -m pip install --upgrade pipStep 3: Install s3cmd
Run the following command to install s3cmd:
pip install s3cmdStep 4: Ensure s3cmd is Executable
By default, Windows may recognize s3cmd as a file without an extension instead of a Python script. Navigate to the following path:
C:\Users\<Username>\AppData\Local\Programs\Python\PythonXX\Scripts\If
s3cmdis present without a.pyextension, rename it tos3cmd.py.Add this location to your system environment variables (
Path).
Step 5: Verify Installation
Run:
s3cmd --versionIf s3cmd does not execute correctly, open the s3cmd file and ensure the first two lines are:
#!C:\Python310\python.exe
#coding: utf-8 -If necessary, run s3cmd using:
python C:\Python310\Scripts\s3cmd.py --versionAlternatively, create a s3cmd.bat file in the same directory as s3cmd.py with the following content:
@echo off
python C:\Python310\Scripts\s3cmd %*Then, retry running:
s3cmd --version2. Configure s3cmd
Run:
s3cmd --configureYou will be prompted to enter the following details:
Access Key: YOUR_ACCESS_KEY
Secret Key: YOUR_SECRET_KEY
Default Region: US
S3 Endpoint: HOST_NAME //Use the Hostname from the Details page.
DNS-style bucket+hostname: HOST_NAME //Use the Hostname from the Details page.
Encryption password: (press Enter to pass)
Path to GPG program: (press Enter to pass)
Use HTTPS protocol: No
HTTP Proxy server name: (press Enter to pass)Test access with supplied credentials:
Test access with supplied credentials? [Y/n]: YIf the connection is successful, you will see:
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)Save settings:
Save settings? [y/N]: yYour configuration will be saved at:
C:\Users\<Username>\AppData\Roaming\s3cmd.ini3. Usage Examples
List Buckets
s3cmd lsCreate a Bucket
s3cmd mb s3://my-bucket-nameDelete an Empty Bucket
s3cmd rb s3://my-bucket-nameList Files in a Bucket
s3cmd ls s3://my-bucket-nameUpload a File to a Bucket
s3cmd put <local_file_path> s3://my-bucket-name/<remote_file_name>Example:
s3cmd put C:\Users\Username\Desktop\files\mv-test.mp4 s3://test-bucket/upload_test.mp4Upload a folder to a Bucket
s3cmd put --recursive <local_file_path> s3://my-bucket-nameExample:
s3cmd put --recursive C:\Users\Username\Desktop\files s3://test-bucketDownload a File from a Bucket
s3cmd get s3://my-bucket-name/<remote_file_name> <local_file_path>Example:
s3cmd get s3://test-bucket/upload_test.mp4 C:\Users\Username\Desktop\mv_download.mp4Delete a File
s3cmd del s3://my-bucket-name/<remote_file_name>Batch Upload Files Example
s3cmd put C:\Users\Username\Desktop\video1.mp4 C:\Users\Username\Desktop\video2.mp4 C:\Users\Username\Desktop\video3.mp4 s3://test-bucket/Batch Download Files Example
s3cmd sync s3://test-bucket/video1.mp4 s3://test-bucket/video2.mp4 s3://test-bucket/video3.mp4 C:\Users\Username\Desktop\download_temp\or
s3cmd get s3://test-bucket/video1.mp4 s3://test-bucket/video2.mp4 s3://test-bucket/video3.mp4 C:\Users\Username\Desktop\download_temp\Batch Delete Files Example
s3cmd del s3://test-bucket/video1.mp4 s3://test-bucket/video2.mp4 s3://test-bucket/video3.mp4Last updated