Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

3 Answers

Try:

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
add comment

In FreeBSD:

sockstat -4 

for IPV6

sockstat -6
share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.