cmdxray / one-liners / lsof-i

lsof -i :8080

Find which process is using a given network port.

▸ Open this command in the explainer →

What it means

lsof lists open files, and on Unix sockets are files; -i :8080 filters to whatever has port 8080 open. The go-to answer to 'address already in use' — it shows the PID you need to stop.

Breakdown, token by token

$ lsof -i :8080

  • lsoflist open files (and the processes that hold them open)
  • -ilist network files — optionally filtered, e.g. -i :8080, -i tcp:80
  • :8080value for -i

See the full reference for lsof — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.