Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Finding the process that is using a certain port in Linux

How may I find out which process(daemon) is listening on a given port if I do not have a service that would specifically listen on that port? For example if port 10101 is open how can I close the respective process?

share|improve this question

marked as duplicate by KronoS, Hennes, CharlieRB, BBlake, Tog Jan 8 '13 at 22:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 0 down vote accepted

You can use lsof (list open files) to get the Process ID.

E.g. lsof | grep 10101

Then use can get the process name from /proc (cd /proc/processIDnumber).

share|improve this answer
Yes. A more specific way would be lsof -i :10101 –  Sebi Jan 8 '13 at 18:07
Thank. I was struggling with the man page which is somehow messed up on my system. –  Hennes Jan 8 '13 at 18:09

You can do netstat -tulpn and grep for the name of the port.

For instance, using your example port, the command would be netstat -tulpn | grep 10101

share|improve this answer

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