lsof -i

Who uses which network port

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Maps processes to sockets. See the flags and examples below, and run `man lsof` for the full reference.

Examples
lsof -i :8080Process on port 8080 · explain & risk-check →
lsof -iTCP -sTCP:LISTEN -P -nAll listeners · explain & risk-check →
Related
ss lsof
Open the full explainer →More in Networking

Reference text is hand-written and may be incomplete — check man lsof for your version. Test destructive commands on a non-production system first.