Time for action – finding the program listening on a specific port

To resolve this issue, we first have to find out which program is listening on the port in question. The process of finding out the program listening on a port depends the operating system we are using. The following methods are used for popular operating systems:

For Linux-based operating systems

For Linux-based operating systems, we can use the following command:

lsof –i :8080

Don't forget to replace 8080 with the appropriate port number.

For OpenBSD and NetBSD

For OpenBSD and NetBSD, we can use the fstat command as follows:

fstat | grep 8080

This will give us a list of connections involving port 8080.

For FreeBSD and DragonFlyBSD

The program for determining a program listening on a port ...

Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.