DevOps Shack _ 500 Essential DevOps Commands
DevOps Shack _ 500 Essential DevOps Commands
Linux Commands
1.
uname -a – Show system information
2.
uptime – Show system uptime
3.
hostname – Show hostname
4.
whoami – Show current user
5.
ls -lah – List directory contents with permissions
6.
pwd – Show current directory
7.
cd /path – Change directory
8.
mkdir -p /path – Create a directory (with parent if
needed)
9.
rm -rf /path – Remove directory recursively
Git Commands
51. git init – Initialize a git repository
Docker Commands
101.docker --version – Check Docker version
Kubernetes (kubectl)
151.kubectl get nodes – List nodes in the cluster
Terraform Commands
201.terraform --version – Check Terraform version
Ansible Commands
276.ansible --version – Check Ansible version
Helm Commands
351.helm version – Check Helm version
Prometheus Commands
376.prometheus --version – Check Prometheus version
382.curl http://localhost:9090/api/v1/status/config –
Fetch Prometheus config
383.curl http://localhost:9090/api/v1/query?query=up
– Run an instant query
385.prometheus --storage.tsdb.retention.time=15d –
Set data retention
391.prometheus --storage.tsdb.max-block-duration=2h –
Adjust block duration
393.prometheus --enable-feature=remote-write-receiver
– Enable remote write
400.prometheus --config.file=prometheus.yml
--web.console.templates=console/ – Load custom web
templates
Grafana Commands
401.grafana-server --version – Check Grafana version
411.curl -u admin:admin
http://localhost:3000/api/dashboards/home – Get
home dashboard
416.curl -X POST
http://localhost:3000/api/dashboards/db -d
'@dashboard.json' – Create dashboard
ArgoCD Commands
426.argocd version – Show ArgoCD CLI version
GitHub Actions
451.gh workflow list – List all GitHub Actions
workflows
GitLab CI/CD
461.gitlab-runner register – Register a new GitLab
runner
CircleCI
487.curl -X GET
http://localhost:3100/loki/api/v1/labels – Get
available labels
488.curl -X GET
'http://localhost:3100/loki/api/v1/query?query={app
="nginx"}' – Query logs