AWS CLI basic commands
General commands syntax
This section is designed to explain the most important concepts and notations used in the set of high-level ‘s3’ commands.
aws s3 <Command> [<Arg> ...]
Syntax:
aws s3 --profile=jetbackup --endpoint-url=https://eu-central-2.storage.jetbackup.com <ACTION> <FILE SOURCE> <FILE DESTINATION>
Supported high-level commands
-
cp - copy
-
mv - move
-
ls - list buckets
-
rm - remove an object
-
mb - make a bucket
-
rb - remove a bucket
-
sync - sync directories with new and updated file
Example:
aws s3 ls --profile=jetbackup --endpoint-url=https://eu-central-2.storage.jetbackup.com
aws s3 mb --profile=jetbackup --endpoint-url=https://us-west-1.storage.jetbackup.com s3://my-new-bucket-name
aws s3 rb --profile=jetbackup --endpoint-url=https://us-west-1.storage.jetbackup.com s3://my-new-bucket-name
Add the –recursive flag for multiple objects operations
aws s3 --profile=jetbackup --endpoint-url=https://eu-central-2.storage.jetbackup.com cp myfile.txt s3://your-company-bucket-name/
aws s3 --profile=jetbackup --endpoint-url=https://eu-central-2.storage.jetbackup.com mv s3://your-company-bucket-name/ s3://your-company-bucket-name2 --recursive
Use of Exclude and Include Filters
Most commands have –exclude “” and –include “” parameters that can achieve the desired result. These parameters perform pattern matching to either ex- or include a particular file or object. The following pattern symbols are supported:
-
*: Matches everything
-
?: Matches any single character
-
[sequence]: Matches any character in sequence
-
[!sequence]: Matches any character not in sequence
See more information on the AWS CLI here: https://aws.amazon.com/cli/
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.