How to view all programs listening on a specific port

In this post I discuss how to check what program is listening to a port on Ubuntu.

The command to use is

netstat -anp <port number> 

The “a” option means that all sockets should be shown, both listening and non-listening ones. The “n” option means numeric. By default netstat translates ports to their service name, making it more difficult to search ports by number. This option solves that. Finally, the “p” option shows the PID and name of the program so that you can tell exactly what’s listening to a port.

Leave a Reply

Your email address will not be published. Required fields are marked *