Install s3cmd (s3 CLI client)
sudo apt install -y s3cmdConfiguration file
s3cmd --configure
${HOME}/.s3cfgCLI
s3cmd mb s3://buk1
s3cmd put /tmp/1m.img s3://buk1
s3cmd ls s3://buk1
s3cmd du
s3cmd rm s3://buk1/1m.img
s3cmd mv s3://buk1/1m.img s3://buk2/1m.img
s3cmd rb s3://buk1
s3cmd rb s3://buk1 --recursive
s3cmd rm s3://lfs/ --recursive --force
# list all objects
s3cmd --host s3.exampl3.com \
--access_key=${AWS_ACCESS_KEY_ID} \
--secret_key=${AWS_SECRET_ACCESS_KEY} \
--host-bucket X \
la
s3cmd \
--access_key xxxxxxxxxxx \
--secret_key xxxxxxxxxxxxxx \
--host-bucket '%(bucket)s.s3.example.com' \
--host s3.example.com \
--signature-v2 \
--no-preserve \
ls s3://foo-duply
s3cmd \
--host s3.example.com \
--access_key=${S3_ACCESS_KEY} \
--secret_key=${S3_SECRET_KEY} \
--host-bucket X \
--recursive \
ls s3://images/ | grep ubuntu-22.04-amd64-disk.raw | tail -1 | cut -d"/" -f2-ACL
s3cmd setacl s3://bucket/path/to/file --acl-public
s3cmd info s3://bucket/path/to/file
s3cmd setacl s3://bucket/path/to/file --acl-private
Links
https://lollyrock.com/articles/s3cmd-with-radosgw/
https://linuxconfig.org/getting-started-with-aws-s3cmd-command-by-examples