Interview Prep/Real-World Interview/awk, sed, grep and jq one-liners

Find all Kubernetes YAML files that set `privileged: true`, and print file and line.

IntermediateHands-onawk, sed, grep and jq one-liners
Answer
grep -rnE --include='*.y*ml' '^\s*privileged:\s*true' manifests/

Key trick → *.y*ml matches both .yaml and .yml. Anchoring with optional leading whitespace avoids matching comments that mention the word.

All Real-World Interview questions Roadmap: Interview readiness

More on awk, sed, grep and jq one-liners