How could I tell what is listening on which ports on Ubuntu? In other words, how do I get a list of ports that are in use?
Asked
Active
Viewed 1.1e+01k times
1 Answers
56
"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.
Kromey
- 3,681
fuser -n tcp 8080will approach it from the other end; showing you which process (if any) is listening on TCP port 8080. – SmallClanger Apr 19 '11 at 18:12sudo netstat -tulpn. – Omid Ariyan Jul 14 '20 at 21:36ssnow https://askubuntu.com/questions/1025568/has-netstat-been-replaced-with-a-new-tool – Nat Nov 20 '23 at 18:16