...
Installation:
Download and install the AWS CLI from AWS CLI Installation Guide.
Configuration:
From your terminal or command line, input:
Code Block $ aws configure --profile <BUCKET-NAME>
Replace
<BUCKET-NAME>
with your actual bucket name found in the "Storage details" panel, e.g.,spinup000123-mybucket
.Input the requested details, which include key, secret, region, and desired output format.
Commands:
Use the AWS CLI for various tasks like copying, listing, deleting, or syncing files. Always remember to specify your profile name using the--profile
option.Examples for a bucket named
spinup000123-mybucket
:Upload a file:
Code Block $ aws s3 --profile spinup000123-mybucket cp test.png s3://spinup000123-mybucket
This command uploads a file named
test.png
from your local directory to the specified S3 bucket.List all files in the bucket:
Code Block $ aws s3 --profile spinup000123-mybucket ls s3://spinup000123-mybucket
Displays a list of all files and directories within the specified S3 bucket.
View size of all objects:
Code Block $ aws s3 --profile spinup000123-mybucket ls --summarize --human-readable --recursive s3://spinup000123-mybucket
Provides a detailed summary of all objects in the bucket, including their sizes in a human-readable format.
Delete a file:
Code Block $ aws s3 --profile spinup000123-mybucket rm s3://spinup000123-mybucket/test.png
Removes the specified file (
test.png
in this case) from the S3 bucket. Exercise caution when deleting files, especially if backups are not in place.
For a comprehensive list of command options and detailed explanations, input
aws s3 help
.