Back to Home
Quick Reference Guides

DevOps Cheat Sheets

Quick reference guides for the most commonly used DevOps tools and commands. Expand any card to view the complete command reference with copy-to-clipboard functionality.

Containers

Docker Commands

Essential Docker commands for containerization, image management, and container orchestration.

Show Commands

Image Management

docker pull <image>

Download an image from Docker Hub

docker images

List all local images

docker build -t <name> .

Build an image from Dockerfile

docker push <image>

Push an image to Docker Hub

docker rmi <image>

Remove an image

Container Operations

docker run -d --name <name> <image>

Run container in detached mode

docker ps

List running containers

docker ps -a

List all containers

docker stop <container>

Stop a running container

docker rm <container>

Remove a container

docker exec -it <container> bash

Open shell in running container

docker logs <container>

View container logs

Docker Compose

docker-compose up -d

Start services in background

docker-compose down

Stop and remove containers

docker-compose logs -f

Follow logs of all services

docker-compose build

Rebuild all services

Orchestration

Kubernetes Essentials

Key kubectl commands, resource definitions, and cluster management operations.

Show Commands

Cluster Info

kubectl cluster-info

Display cluster information

kubectl get nodes

List all nodes in the cluster

kubectl get namespaces

List all namespaces

kubectl config get-contexts

List available contexts

Pod Management

kubectl get pods

List pods in current namespace

kubectl get pods -A

List pods in all namespaces

kubectl describe pod <pod>

Show details of a pod

kubectl logs <pod>

Print container logs

kubectl exec -it <pod> -- bash

Execute command in pod

kubectl delete pod <pod>

Delete a pod

Deployments & Services

kubectl get deployments

List all deployments

kubectl get services

List all services

kubectl apply -f <file>.yaml

Apply a configuration file

kubectl scale deployment <name> --replicas=3

Scale a deployment

kubectl rollout status deployment/<name>

Check rollout status

Version Control

Git Commands

Complete Git reference including branching, merging, rebasing, and advanced operations.

Show Commands

Basic Commands

git init

Initialize a new Git repository

git clone <url>

Clone a repository

git status

Check working directory status

git add .

Stage all changes

git commit -m "<message>"

Commit staged changes

git push origin <branch>

Push to remote repository

git pull origin <branch>

Pull from remote repository

Branching

git branch

List branches

git branch <name>

Create a new branch

git checkout <branch>

Switch to a branch

git checkout -b <branch>

Create and switch to new branch

git merge <branch>

Merge branch into current branch

git branch -d <branch>

Delete a branch

Advanced

git rebase <branch>

Rebase current branch

git stash

Stash current changes

git stash pop

Apply stashed changes

git reset --hard HEAD~1

Reset to previous commit

git log --oneline

View commit history (compact)

Operating Systems

Linux Commands

Essential Linux commands for system administration, file management, and networking.

Show Commands

File Operations

ls -la

List files with details

cd <directory>

Change directory

pwd

Print working directory

cp <src> <dest>

Copy files

mv <src> <dest>

Move or rename files

rm -rf <path>

Remove files/directories

mkdir -p <path>

Create nested directories

System Info

top

Display running processes

df -h

Show disk usage

free -h

Display memory usage

uname -a

Show system information

ps aux

List all processes

Networking

curl <url>

Make HTTP request

netstat -tuln

Show listening ports

ping <host>

Test network connectivity

ssh user@host

SSH into remote server

scp <file> user@host:<path>

Secure copy to remote

Infrastructure

Terraform Syntax

HCL syntax reference, resource configurations, and state management commands.

Show Commands

Core Commands

terraform init

Initialize working directory

terraform plan

Preview changes

terraform apply

Apply changes

terraform destroy

Destroy infrastructure

terraform validate

Validate configuration

terraform fmt

Format configuration files

State Management

terraform state list

List resources in state

terraform state show <resource>

Show resource details

terraform state rm <resource>

Remove resource from state

terraform import <addr> <id>

Import existing resource

terraform refresh

Update state with real infrastructure

Workspaces

terraform workspace list

List workspaces

terraform workspace new <name>

Create new workspace

terraform workspace select <name>

Switch workspace

terraform workspace delete <name>

Delete a workspace

Cloud

AWS CLI Reference

Common AWS CLI commands for EC2, S3, IAM, and other essential services.

Show Commands

EC2

aws ec2 describe-instances

List EC2 instances

aws ec2 start-instances --instance-ids <id>

Start an instance

aws ec2 stop-instances --instance-ids <id>

Stop an instance

aws ec2 terminate-instances --instance-ids <id>

Terminate an instance

aws ec2 describe-security-groups

List security groups

S3

aws s3 ls

List S3 buckets

aws s3 ls s3://<bucket>

List bucket contents

aws s3 cp <file> s3://<bucket>/

Upload file to S3

aws s3 sync <dir> s3://<bucket>/

Sync directory to S3

aws s3 rm s3://<bucket>/<key>

Delete S3 object

IAM

aws iam list-users

List IAM users

aws iam list-roles

List IAM roles

aws iam get-user

Get current user details

aws sts get-caller-identity

Get current identity

Need More Resources?

Check out our comprehensive documentation and hands-on labs for in-depth learning.