Sample output
COMMAND PID USER FD TYPE DEVICE NODE NAME
node 48213 ada 23u IPv6 0x9a3f1 TCP *:8080 (LISTEN)
PID 48213 is the one to stop. kill 48213 asks it politely; add -9 only if it ignores you.
When you would reach for it
Any “address already in use” error, a dev server that survived a closed terminal, or a container that mapped a port you wanted. It is also a quick audit tool: drop the port filter and you get every listener on the machine.
Gotchas
- Without
sudoyou only see your own processes, so a system service can look invisible. - An empty result is a real answer. If nothing is listening, the port conflict is somewhere else, often a proxy or a container port mapping.
- Docker holds ports via its own proxy, so the PID you find may belong to Docker rather than your app.
Variants
$ ss -ltnp | grep :8080
Linux, no lsof installed
$ kill -9 $(lsof -t -iTCP:8080 -sTCP:LISTEN)
Find and stop in one step. Check before you run it