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

Replace `DEBUG` with `INFO` in a config file in place, keeping a backup.

BeginnerHands-onawk, sed, grep and jq one-liners
Answer
sed -i.bak 's/^LOG_LEVEL=DEBUG$/LOG_LEVEL=INFO/' app.conf

Key trick → Anchor with ^ and $ so you only change the exact setting line. -i.bak writes app.conf.bak first (on macOS -i always requires an argument).

All Real-World Interview questions Roadmap: Interview readiness

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