Earlier, I explained how to install AWS CLI v2 on Raspberry Pi, today I’ll try and show how to use the aws cli to get things done. Most of my work is done with S3.
First of all, this post is for me, and for things I do a lot, if you’re trying to figure out if aws-cli is for you or not, checkout the official documention for aws-cli .
Show all objects/buckets
aws s3 ls
2021-05-26 17:12:20 my-unique-bucket-05262021
Show all objects in a bucket
aws s3 ls my-unique-bucket-05262021
2021-07-16 11:49:32 3071344 ImageOptim.tbz2
Upload a local file up to s3
aws s3 cp ImageOptim.tbz2 s3://my-unique-bucket-05262021
Create a URL that someone can use to download said file
aws s3 presign my-unique-bucket-05262021/ImageOptim.tbz2 --expires-in 1209600
You should be able to Download, if today is within two weeks of the day I issued this command.