DevOps Quick Revision Cheat Sheet: Essential Commands for Docker, Kubernetes, Terraform, Git, AWS, and Linux

Listen to this Post

Preparing for a DevOps interview? This comprehensive cheat sheet covers must-know commands and tools to help you ace your next technical discussion.

Docker Commands

  • List containers: `docker ps -a`
  • Build an image: `docker build -t .`
  • Run a container: `docker run -d -p 8080:80 –name `
  • Remove a container: `docker rm `
  • View logs: `docker logs `

Kubernetes Commands

  • Get pods: `kubectl get pods -A`
  • Describe a pod: `kubectl describe pod `
  • Apply a manifest: `kubectl apply -f deployment.yaml`
  • Delete a pod: `kubectl delete pod `
  • Port forwarding: `kubectl port-forward 8080:80`

Terraform Commands

  • Initialize: `terraform init`
  • Plan changes: `terraform plan`
  • Apply changes: `terraform apply -auto-approve`
  • Destroy resources: `terraform destroy`
  • Show state: `terraform show`

Git Commands

  • Clone a repo: `git clone `
  • Stage changes: `git add .`
  • Commit changes: `git commit -m “message”`
  • Push to remote: `git push origin `
  • Pull latest changes: `git pull`

AWS CLI Commands

  • List S3 buckets: `aws s3 ls`
  • Create an EC2 instance: `aws ec2 run-instances –image-id ami-xyz –instance-type t2.micro`
  • Describe instances: `aws ec2 describe-instances`
  • Copy files to S3: `aws s3 cp file.txt s3://bucket-name/`

Linux Commands

  • Check disk space: `df -h`
  • Search for a file: `find / -name “filename”`
  • Check running processes: `top` or `htop`
  • Network stats: `netstat -tulnp`
  • Compress a directory: `tar -czvf archive.tar.gz /path/to/dir`

You Should Know:

  • Docker Cleanup:
    docker system prune -a --volumes 
    
  • Kubernetes Context Switching:
    kubectl config use-context <cluster_name> 
    
  • Terraform State Management:
    terraform state list 
    terraform state rm <resource> 
    
  • Git Branching Strategy:
    git checkout -b feature-branch 
    git merge main 
    
  • AWS Security Check:
    aws iam list-users 
    aws iam list-access-keys --user-name <user> 
    

What Undercode Say:

Mastering DevOps requires hands-on practice with these commands. Automate deployments, manage infrastructure as code, and ensure CI/CD pipelines are robust. Use Linux for scripting (awk, sed, grep), Kubernetes for orchestration, and Terraform for IaC.

Expected Output:

A well-structured DevOps cheat sheet with verified commands for quick revision.

Relevant URLs (if applicable):

(No unrelated URLs or comments included.)

References:

Reported By: S Wakhare – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image