Note: almost all commands allow a --dryrun option that when used will output what would have been done if it was not a dry run.
Documentation: S3 sub-command
$ aws s3 ls $ aws s3 ls myfolder$ aws s3 cp my-local-file.txt s3://mybucket/$ aws s3 cp s3://mybucket/the-file.txt ./To delete a single file:
$ aws s3 rm s3://mybucket/the-file.txtTo remove all files in a bucket:
$ aws s3 rm s3://mybucket/ --recursiveTo remove only files that match a glob pattern (note that we're excluding everything and then including just the glob that we want):
$ aws s3 rm s3://acadia-database-daily-backups --recursive --exclude "*" --include "*.sql.gz"To remove all files except those that match a glob pattern:
$ aws s3 rm s3://acadia-database-daily-backups --recursive --exclude "*.bak"$ aws s3 mb s3://mybucket$ aws s3 rb s3://mybucketTo grab everything from a bucket and sync to current directory:
$ aws s3 sync s3://acadia-database-daily-backups ./To sync only certain files from bucket to local directory:
$ aws s3 sync s3://acadia-database-daily-backups ./ --exclude "*" --include "acadia-staging*"Sync current local directory to S3:
$ aws s3 sync ./ s3://mybucket/Documentation: EC2 sub-command
$ aws ec2 describe-instances --profile acadia-admin --region us-west-2