AWS CLI Cheat Sheet

Every AWS CLI command in the library, on one page. Search, filter by category, or jump to a full command reference for detailed examples.

CommandSyntaxDescription
aws s3 cpaws s3 cp <source> <destination> [--recursive]Copies files to, from, or between S3 buckets.
aws s3 syncaws s3 sync <source> <destination> [--delete]Synchronizes a local directory and an S3 bucket, uploading only changed files and optionally deleting removed ones.
aws s3 lsaws s3 ls [<s3-path>]Lists S3 buckets or the objects within a bucket/prefix.
aws ec2 describe-instancesaws ec2 describe-instances [--instance-ids <id>]Describes one or more EC2 instances and their current state.
aws ec2 start-instancesaws ec2 start-instances --instance-ids <id>...Starts one or more stopped EC2 instances.
aws ec2 stop-instancesaws ec2 stop-instances --instance-ids <id>...Stops one or more running EC2 instances.
aws configureaws configure [--profile <name>]Interactively sets up credentials, default region, and output format for the CLI.
aws sts get-caller-identityaws sts get-caller-identityShows which AWS identity (account/user/role) the current credentials belong to — the fastest way to check what you're authenticated as.
aws logs tailaws logs tail <log-group> [--follow]Tails a CloudWatch Logs group, optionally following new events as they arrive.
aws cloudfront create-invalidationaws cloudfront create-invalidation --distribution-id <id> --paths <paths>Invalidates cached objects in a CloudFront distribution so the next request re-fetches them from the origin.