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

Find which process is listening on port 8080 in one line.

BeginnerHands-onawk, sed, grep and jq one-liners
Answer
sudo ss -ltnp 'sport = :8080'
# or
sudo lsof -iTCP:8080 -sTCP:LISTEN -n -P

Key trick → ss filters natively, so there's no need to grep. -p needs root to show processes owned by other users.

All Real-World Interview questions Roadmap: Interview readiness

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