Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

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

share|improve this question


netstat -nap | grep 7080
share|improve this answer
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

In FreeBSD:

sockstat -4 

for IPV6

sockstat -6
share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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