Monitor Listening Ports on Mac

Want to watch ports appear and disappear while you start services? Two approaches.

Terminal: poll lsof

while true; do clear; lsof -nP -iTCP -sTCP:LISTEN | sort -k9; sleep 2; done

Works, but it occupies a terminal, redraws everything, and can’t search.

Open PortPeek from the MacPeek menu-bar icon and the list refreshes every 2 seconds (configurable, 1–10 s) only while PortPeek’s screen is open — it doesn’t poll in the background, so it’s safe to leave running all day.

Typical uses:

  • Confirm your dev server actually bound the port you expected.
  • Spot a leftover process after a crash.
  • Check whether something is listening on all interfaces (*) instead of just localhost.

PortPeek watches ports only; for CPU or memory use Activity Monitor. Learn more in the docs.

PortPeek gives you the same visibility from your Mac menu bar. See what's using your ports. Kill it in one click. It is a free, open-source utility inside MacPeek.