aws cli
AWS CLI v2Quick reference for the AWS Command Line Interface: configure credentials, IAM identity, EC2 / Lambda / S3 / DynamoDB / IAM, profiles, SSO, and pagination / output formatting — with common options and practical examples.
40 commands
Help
aws --versionPrint awscli version (v2.x).
aws --versionaws helpTop-level help — list service groups and basic usage.
aws helpaws <service> helpShow commands for one service.
<service> help; aws <service> <command> help
aws s3 helpaws <service> <command> helpShow every flag + parameter for a single API call.
aws ec2 run-instances helpaws <service> <command> --generate-cli-skeletonPrint a JSON skeleton with every required / optional field for a command — paste back as your input.
--generate-cli-skeleton <input|output>; --cli-input-json <file>; --cli-input-yaml <file>
aws ec2 run-instances --generate-cli-skeleton > ec2.jsonConfigure
aws configureInteractive wizard — sets access key, secret, output format, region in `~/.aws/credentials` and `~/.aws/config`.
aws configureaws configure --profile <name>Same as `aws configure` but writes to a named profile.
--profile dev; --profile prod; --no-prompt
aws configure --profile prodaws configure get <key>Read a single value out of the active config.
default.region; default.output; <key>; --profile <name>
aws configure get region --profile prodaws configure set <key> <value>Set a single config value.
<key> <value>; --profile <name>
aws configure set region us-west-2aws configure listShow the active configuration (profile, region, access-key id, secret redacted).
aws configure listSSO / Identity
aws sso login --profile <name>Launch the SSO device-flow login (or browser redirect). Sets short-lived credentials for the profile.
--profile dev; --no-browser; --use-device-code
aws sso login --profile devaws sso configureConfigure an SSO profile interactively (start URL, region, account, role).
aws sso configureaws sts get-caller-identityPrint the IAM principal (account / arn / user-id) for the active credentials — sanity-check after configuring.
--profile <name>; --no-verify-ssl; --endpoint-url <url>
aws sts get-caller-identityaws sts assume-role --role-arn <arn> --role-session-name <name>Switch to an IAM role, getting temporary credentials — useful for cross-account access.
--role-arn; --role-session-name; --external-id; --mfa-serial <arn>; --serial-number <arn>; --token-code <mfa>
aws sts assume-role --role-arn arn:aws:iam::123456789012:role/Admin --role-session-name adminOutput
aws <service> <command> --output <format>Choose output format: `json` (default), `text`, `table`. Combine with `--query` for jq-like projection.
json; text; table; yaml; yaml-stream
aws ec2 describe-instances --output tableaws <service> <command> --query '<JMES>'Project the response with a JMESPath expression (jq-like).
--query 'Reservations[].Instances[].InstanceId'; --query 'Reservations[].Instances[].[InstanceId,State.Name]'
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name]' --output tableaws <service> <command> --no-paginateDisable auto-pagination — return the first page only (faster; useful when you only want a count).
aws s3 ls --no-paginateaws <service> <command> --cli-binary-format raw-in-base64-outRead input parameters as base64 — needed for binary params like `--zip-file fileb://lambda.zip`.
raw-in-base64-out; base64
aws lambda update-function-code --function-name fn --zip-file fileb://out.zip --cli-binary-format raw-in-base64-outEC2
aws ec2 describe-instancesList every EC2 instance with full detail.
--instance-ids i-xxx; --filters Name=tag:Name,Values=prod; --query; --output
aws ec2 describe-instances --query 'Reservations[].Instances[].{ID:InstanceId,State:State.Name}' --output tableaws ec2 start-instances --instance-ids <id>Start one or more stopped instances.
--instance-ids i-xxx i-yyy
aws ec2 start-instances --instance-ids i-0abc123aws ec2 stop-instances --instance-ids <id>Stop one or more running instances (without terminating).
aws ec2 stop-instances --instance-ids i-0abc123aws ec2 create-key-pair --key-name <name> --query 'KeyMaterial' --output text > key.pemCreate a new SSH key pair and save the private key to a `.pem` file with the right permissions.
aws ec2 create-key-pair --key-name dev --query 'KeyMaterial' --output text > dev.pem && chmod 400 dev.pemS3
aws s3 lsList buckets (without args) or files under a prefix.
s3://<bucket>/<prefix>; --recursive; --human-readable; --summarize
aws s3 ls s3://my-bucket/data/aws s3 cp <local> s3://<bucket>/<key>Upload or copy a file. `s3://...` can be source or destination.
--recursive; --exclude '*'; --include '*.log'; --storage-class STANDARD|GLACIER|...; --acl public-read
aws s3 cp ./build/ s3://my-bucket/release/ --recursiveaws s3 sync <src> s3://<bucket>/<dst>Two-way S3 directory sync (uploads new / changed files, deletes destination-side extras unless `--delete` is passed).
--delete; --exclude; --include; --no-progress; --exact-timestamps
aws s3 sync ./dist s3://my-bucket/app/ --deleteaws s3 mb s3://<bucket>Make a new S3 bucket. Region defaults to us-east-1; pass `--region` to override.
--region eu-west-1
aws s3 mb s3://my-new-bucket --region eu-west-1aws s3 rb s3://<bucket>Remove bucket (use `--force` to wipe objects first).
--force; --no-progress
aws s3 rb s3://old-bucket --forceaws s3 presign s3://<bucket>/<key> --expires-in <seconds>Generate a presigned URL that expires after `<seconds>` — useful for sharing private files.
aws s3 presign s3://my-bucket/file.pdf --expires-in 3600Lambda
aws lambda list-functionsList every Lambda function in the current region.
--function-version ALL; --max-items 50; --query 'Functions[].FunctionName'
aws lambda list-functions --query 'Functions[].FunctionName' --output textaws lambda update-function-code --function-name <name> --zip-file fileb://fn.zipUpdate a function's code from a local zip. Use `--cli-binary-format raw-in-base64-out` on some setups.
aws lambda update-function-code --function-name my-fn --zip-file fileb://out.zip --cli-binary-format raw-in-base64-outaws lambda invoke --function-name <name> --payload '{}' out.jsonInvoke a function synchronously — write the response to `out.json`.
--invocation-type Event|RequestResponse|DryRun; --log-type Tail; --cli-binary-format
aws lambda invoke --function-name my-fn --payload '{"key":"value"}' out.json && cat out.jsonDynamoDB
aws dynamodb scan --table-name <name>Scan a DynamoDB table — reads every item (use `query` with a key condition when possible).
--table-name; --filter-expression; --projection-expression; --select; --max-items
aws dynamodb scan --table-name users --max-items 5aws dynamodb query --table-name <name> --key-condition-expression 'pk = :v' --expression-attribute-values '{":v":{"S":"u1"}}'Query items by partition key with a key condition expression.
aws dynamodb query --table-name users --key-condition-expression '#u = :u' --expression-attribute-names '{"#u":"userId"}' --expression-attribute-values '{":u":{"S":"u1"}}'IAM
aws iam list-usersList every IAM user in the account.
--path-prefix /; --max-items
aws iam list-users --query 'Users[].UserName' --output textaws iam create-user --user-name <name>Create a new IAM user.
aws iam create-user --user-name new-devaws iam attach-user-policy --user-name <name> --policy-arn <arn>Attach a managed policy to a user.
aws iam attach-user-policy --user-name new-dev --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccessProfiles
aws --profile <name> <service> <cmd>Run any command under a named profile (must already be configured).
--profile prod; --profile dev; --profile staging
aws --profile prod s3 lsAWS_PROFILE=<name> aws <service> <cmd>Set the profile via environment variable — useful in scripts.
AWS_PROFILE=prod aws lambda list-functionsDiagnose
aws --debug <service> <cmd>Dump HTTP wire-level logs to stderr — useful when diagnosing signing or payload errors.
--debug; --no-verify-ssl; --ca-bundle <file>; --cli-read-timeout <seconds>
aws --debug s3 ls 2> aws.logaws --no-sign-request <service> <cmd>Make unsigned requests — useful against public buckets / test endpoints.
aws --no-sign-request s3 cp public.txt s3://public-bucket/xRelated command cheatsheets
azure cli
Quick reference for the Azure CLI (az): authentication, subscription / resource management, VM / AKS / Storage / App Service / Key Vault, query formatting, and CI-friendly workflows — with common options and practical examples.
43 commands
Azure CLI 2.60+
gcloud
Quick reference for gcloud (Google Cloud CLI), gsutil, and bq commands: authentication, project / IAM, Compute / GKE / BigQuery / Cloud Storage, config, and Cloud Build / Deploy — with common options and practical examples.
48 commands
gcloud 480+
kubectl
Quick reference for kubectl, the Kubernetes command-line client: contexts, get/describe, apply, logs/exec, rollout, scaling and debugging — with common options and practical examples.
40 commands
kubectl 1.28+
docker
Quick reference for everyday Docker CLI commands: container lifecycle, image builds, logs / exec, networking, volumes, Compose, registry and housekeeping — with common options and practical examples.
46 commands
Docker Engine 24.0+
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About AWS CLI
The AWS Command Line Interface (awscli) is Amazon's official tool for controlling AWS services from a terminal. The current line is AWS CLI v2 (released 2020; awscli 1.x is in maintenance). v2 ships as a single installer (msi / pkg / signed zip), supports SSO, the new `aws sso login` flow, automatic pagination, and binary parameters (handles base64-encoded blobs like Lambda zip uploads). Configuration is split into `~/.aws/config` (region, output format) and `~/.aws/credentials` (access keys), but with IAM Identity Center / SSO you typically use `aws sso configure` instead of long-lived keys. Every AWS service is reachable via `aws <service> <command>` — `aws ec2 describe-instances`, `aws s3 sync`, `aws lambda invoke`, `aws dynamodb scan`. The CLI is Apache-2.0 licensed. The newer alternative is `aws-shell` (interactive completion) and the AWS CDK (`cdk`) for infrastructure-as-code. AWS CLI v2 does not upload your source code anywhere except the API calls you explicitly make.
Cheatsheet version 1.0.0