Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing question.

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
1  
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.