AWS
aws — AWS CLI 2.13.29 Command Reference
How-to
configure
Retrieve instance metadata - Amazon Elastic Compute CloudS3
count object numbers and size
aws s3 ls s3://my-bucket/path/to --recursive --human-readable --summarize
最後會列出Total Objects, 跟Total Size
add metadata to all objects in bucket
aws s3 cp --recursive --metadata-directive REPLACE --content-type "image/jpeg" s3://your-bucket-name/ s3://your-bucket-name/
set all objects public-read
aws s3 ls s3://my-bucket/path/to/ --recursive | awk -F ' ' '{cmd="aws s3api put-object-acl --acl public-read --bucket mybucket --key "$4; system(cmd)}'
,取後面的key,然後用神奇的awk,搭配 system
執行命令。