apt install awscli
# Download
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
#Extract
unzip awscli2.zip
#install
sudo ./aws/install
Note that this is optional, this will just install the default credentials for access aws. A better alternative is to create a credentials file, load it into environment variables and invoke aws command line. In this way, different credentials may be used for different access.
aws configure
Load the credentialials using the “.” or “source” directive.
. credentials.aws
# aws credentials
export AWS_ACCESS_KEY_ID=AKIAWasdfJPMHVCL2G43
export AWS_SECRET_ACCESS_KEY=+ZAeQOHjCfHVvLvbhXCni2vasdfwOnVimhJNkvMKN
List bucket contents
aws s3 ls s3://<bucket>/path
Copy from local to s3 bucket
aws s3 cp <local file> s3://<bucket><file name>
Synchronize local directory to s3 path
aws s3 sync <local directory> s3://<bucket><oath>