5MinStudy
Loading...
Loading...
Quick reference guides for common DevOps tools and commands
Ansible ad-hoc commands, playbook flags, and Vault operations.
$ ansible all -m ping -i inventoryPing all hosts in inventory
$ ansible all -a "uptime" -i inventoryRun ad-hoc command on all hosts
$ ansible web -m copy -a "src=file dest=/tmp/" -i inventoryCopy file to web hosts
$ ansible web -m service -a "name=nginx state=restarted" -i inventoryRestart a service on hosts
$ ansible-playbook -i inventory site.ymlRun a playbook with inventory
$ ansible-playbook -i inventory site.yml --check --diffDry-run with diff (no changes applied)
Common AWS CLI operations for S3, EC2, IAM, EKS, and more.
$ aws configureConfigure credentials and default region/output
$ aws sts get-caller-identityShow current AWS identity
$ aws s3 lsList buckets
$ aws s3 cp file s3://bucket/pathCopy file to S3
$ aws s3 sync . s3://bucket/pathSync local directory to S3
$ aws s3 rm s3://bucket/path --recursiveDelete objects recursively
Frequently used Docker CLI commands for images, containers, and networks.
$ docker versionShow Docker client/server versions
$ docker infoDisplay system-wide info
$ docker imagesList images
$ docker pull nginx:latestPull an image from a registry
$ docker rmi IMAGERemove an image
$ docker ps / docker ps -aList running / all containers
Essential Git commands for version control and collaboration.
$ git initInitialize a new Git repository
$ git clone URLClone a repository from URL
$ git statusShow working tree status
$ git add .Stage all changes for commit
$ git commit -m "message"Commit staged changes with message
$ git commit -am "message"Stage and commit all tracked files
Kubectl commands for pods, deployments, services, and debugging.
$ kubectl config get-contextsList kubeconfig contexts
$ kubectl config use-context NAMESwitch current context
$ kubectl get nodesList cluster nodes
$ kubectl get pods -AList pods across all namespaces
$ kubectl get svc -AList services across all namespaces
$ kubectl describe pod POD -n nsDescribe a pod for details and events
Essential Linux commands for daily administration and troubleshooting.
$ ls -laList all files with permissions/owner/size
$ cd /path/to/dirChange current directory
$ pwdPrint working directory
$ mkdir -p dir/subdirCreate directory (including parents)
$ touch fileCreate an empty file or update timestamp
$ cp -r src dstCopy files/directories recursively
Common Python commands for development, package management, and scripting.
$ python --versionCheck Python version
$ python3 script.pyRun a Python script
$ python -m venv venvCreate a virtual environment
$ source venv/bin/activateActivate virtual environment (Linux/Mac)
$ venv\Scripts\activateActivate virtual environment (Windows)
$ deactivateDeactivate virtual environment
Terraform CLI for formatting, validation, planning, and state operations.
$ terraform -install-autocompleteEnable CLI autocompletion
$ terraform initInitialize working directory (download providers/modules)
$ terraform fmt -recursiveFormat configuration files
$ terraform validateValidate configuration for syntax/consistency
$ terraform plan -out=tfplanCreate an execution plan (saved to file)
$ terraform apply tfplanApply a saved plan