What is `jq` and why is it essential for DevOps work?
IntermediateConceptPackages, Shell & Text Tools
Answer
jq is a command-line JSON processor; APIs, cloud CLIs and kubectl all emit JSON.
curl -s https://api.github.com/repos/torvalds/linux | jq '.stargazers_count'
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | "\(.InstanceId) \(.State.Name)"'
kubectl get pods -o json | jq -r '.items[] | select(.status.phase!="Running") | .metadata.name'
-r outputs raw strings without quotes.
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate