Operating System - HP-UX
1834754 Members
3537 Online
110070 Solutions
New Discussion

How to find a process using a port value

 
SOLVED
Go to solution
Clint Gibler
Frequent Advisor

How to find a process using a port value

I need a way to discover what process on the 11.11 server I have is using a cetain port (port value = 12349) so that I can kill it as I need to free the port up again. I could re-boot but it would be easier if there was a way to find the process.
8 REPLIES 8
Sandman!
Honored Contributor
Solution

Re: How to find a process using a port value

Use lsof to find the process on the local machine using port 12349

# lsof -i@servername:12349
Court Campbell
Honored Contributor

Re: How to find a process using a port value

in case you do not already have it installed.

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

"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jaime Bolanos Rojas.
Honored Contributor

Re: How to find a process using a port value

Clint,

This link will give you a little bit more of details on using lsof command:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1084531&admit=-682735245+1178554680228+28353475

Regards,

Jaime.
Work hard when the need comes out.
Clint Gibler
Frequent Advisor

Re: How to find a process using a port value

what is lsof? I try the command you gave me but it just says sh: lsof: not found.
does it need to be run from someplace or is this a feature I don't have installed?
Clint Gibler
Frequent Advisor

Re: How to find a process using a port value

sorry didn't see the new posts
Steven E. Protter
Exalted Contributor

Re: How to find a process using a port value

Shalom,

lsof is a non-standard but very useful comand to accomplish your goal.

Click the link posted earlier

swinstall the depot.

Run the command posted earlier to identify the process for death.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sandman!
Honored Contributor

Re: How to find a process using a port value

You may want to see if lsof is on on your system and then by specifying its full path if it exists.

# whereis lsof
Clint Gibler
Frequent Advisor

Re: How to find a process using a port value

That worked Thanks,