unix

How do I list the process listening on a specific port?

To list the processes listening on a specific port, you can use lsof.

lsof -i :

So for example, to see what’s listening on port 80:

lsof -i :80

The output will look similar to this:

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 21149 apache 3u IPv4 55419598 TCP *:http (LISTEN)
httpd 21150 apache 3u IPv4 55419598 TCP *:http (LISTEN)
httpd 21151 apache 3u IPv4 55419598 TCP *:http (LISTEN)

Click to comment

Leave a Reply

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

To Top