How can I find out which process is listening on a port on linux?

link|improve this question
feedback

migrated from stackoverflow.com Mar 16 '11 at 11:12

This question came from our site for professional and enthusiast programmers.

5 Answers

up vote 7 down vote accepted

as root

sudo lsof -i
sudo netstat -lptu
link|improve this answer
1  
I generally do: "sudo netstat -anp | grep port_number" – Leonardo Constantino Mar 16 '11 at 19:20
feedback

With lsof -iTCP -sTCP:LISTEN you get a list of all TCP ports in state LISTEN and their associated processes (command and pid are in the first two columns).

link|improve this answer
feedback

you can use "netstat"

netstat -anp | less

will show you the PID and process name as the last column, checkout "man netstat" if you want to change the options

link|improve this answer
feedback

You can use netstat to list all processes listening on some port. But I don't how to filter for a specific one.

link|improve this answer
feedback

netstat should help if you are on Linux. For more information see man netstat.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.