4

I have a process which I need to run on a specific port. I have started some other process on that port and I need to kill it.

Unfortunately, I don't remember the name/pid of the other process so I need a quick way to find which PID are associated with it.

I tried lsof -i :7080 but that returned nothing. I can telnet localhost 7080 so I know its running.

For reference I'm running RHEL5

11

Try:

netstat -nap | grep 7080
  • It might be better to use netstat -nap | grep :7080. Especially for lower ports it reduces the output a lot. – Gert Sep 23 '10 at 11:13
  • why does this produce an answer when lsof -i:7080 doesn't? OR does it? – jmtd Sep 24 '10 at 22:21
3

In FreeBSD:

sockstat -4 

for IPV6

sockstat -6
0

As root, with ss installed:

ss -p -l '( sport = :7080 )'

You should also check the files in /etc/xinetd.d and the output of rpcinfo -p

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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