1

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?

Sebi
  • 1,134

2 Answers2

0

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

mikhailvs
  • 101
0

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

Hennes
  • 65,142