1827630 Members
3226 Online
109966 Solutions
New Discussion

port processes

 
SOLVED
Go to solution
Kathy McGohan_1
Frequent Advisor

port processes

How do you tell what port a process is using? Thanks in advance for your help.
7 REPLIES 7
Paula J Frazer-Campbell
Honored Contributor
Solution

Re: port processes

Hi Kathy

Try
netstat -an

HTH

Paula
If you can spell SysAdmin then you is one - anon
Kathy McGohan_1
Frequent Advisor

Re: port processes

Thanks Paula. I was doing a netstat -a, but not -an. I had put this message in for one of my co-workers who is downstairs in the machine room.
Kofi ARTHIABAH
Honored Contributor

Re: port processes

Kathy:

you can also use the lsof utility to determine the process that owns a port. netstat -an does not associate a PID to a port/socket. lsof does.

You can get a copy of lsof from:

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.51/

it is an absolute life saver.

good luck
nothing wrong with me that a few lines of code cannot fix!
Kathy McGohan_1
Frequent Advisor

Re: port processes

Kofi, thanks for the information on lsof. I downloaded it and installed it, but when I try to run lsof, it gives me an error message saying, "lsof was built for a 32 bit kernel but this is a 64 bit kernel".
Is there an lsof for a 64 bit kernel?
Kofi ARTHIABAH
Honored Contributor

Re: port processes

Kathy:

Yep - the bin version that is posted on the porting centre is 32 bit. excerpt from the website "Note that the binary releases of lsof on this archive will ONLY run on OS release they were compiled on and will run on 32-bit HP-UX only. If you have any other release of HP-UX, you must build lsof yourself from the source code."

I do not have a 64 bit OS and so cannot build it for you, but I know that someone posted lsof for 64 bit HPUX on the forums (unfortunately, the search feature is not working so I cannot dig it up for you...) would someone remember where the 64 bit version of lsof is?

Or if you want to build it yourself, it should be quite straightforward... you would need ansi c or gcc
nothing wrong with me that a few lines of code cannot fix!
Kathy McGohan_1
Frequent Advisor

Re: port processes

Kofi, thanks for checking this out for me. I'm pretty busy right now and am pressed for time. I'll just wait and see if someone remembers where the compiled 64 bit version is.
Stefan Farrelly
Honored Contributor

Re: port processes


I dont think i ever posted the statically linked 64bit version of lsof to the list, couldnt send it as an attachment due to site problems, lets try again with the new format site....


Im from Palmerston North, New Zealand, but somehow ended up in London...