How do I tell what is running on which ports in Ubuntu?

“In use” as in with an active connection, or that programs are listening on? Or both?

Run sudo netstat -lp in your terminal; this will tell you what ports are open to receive connections, and what programs are listening on them. Try sudo netstat -p for the same thing, plus currently-active connections.

Leave a Comment