how do I find the process that is running on a port in HP-Unix?
Murali
how do I find the process that is running on a port in HP-Unix?
Murali
netstat -a
netstat -a won't identify the process. For that you need lsof -i.
Hi,
But i don't think we have lsof on HP. As far as my knowledge goes it is there on Solaris only. Is that right dude?
Murali
Funny you should ask. I was the first person to port lsof to HP-UX.... but that was HP-UX 3.1. lsof has been available for every version of HP-UX since then.
Actually, lsof is available for virtually every version of unix.
You can get lsof for HP-UX at The HP-UX Porting and Archive Centre
Uuuh, mister Manduva.
Perderabo is not a "Dude", but as he shows a master.
Try to be polite and respectfull.
Thanks Perderabo.
netstat -a does show you the process where you can grep for using ps. Indeed lsof is much more suited for this job.
Regs David
Actually, I sometimes use "dude" myself. I doubt that it was intended as an insult or anything.
But you'l have to help me out with your use of netstat. How do you reach the pid starting from the output of netstat?
Hi David/Perderabo,
No offense intended. was just a common lingo thats used in this part of the world. Anyhow, if offended sorry for that...
Murali
Hi Murali,
my remark was ment as a sort of joke as well.
However, he remains the master !
Next time I will add some extra It clarifies the feeling behind a word.
Perderabo,
netstat -a | grep <port-number>
Now you'll see the process description(most right column) that is attached.
When doing a ps -ef | grep <process found using netstat>
Now you also have the PID resolved using ps. I know it's not always working. So let's just forget the whole thing and use lsof
Regs David