Operating System - HP-UX
1836664 Members
2926 Online
110102 Solutions
New Discussion

Show the name of the program to which each socket belongs

 
Gian Paolo
Occasional Advisor

Show the name of the program to which each socket belongs

Hi,

whit Linux if I want know which program open a socket I run:
netstat -lutanp | grep LISTEN
tcp6 0 0 :::80 :::* LISTEN 5361/apache2
tcp 0 0 0.0.0.0:5865 0.0.0.0:* LISTEN 4326/python

whit HP/ux I don'know any command...

Can you help me..?
4 REPLIES 4
Muthukumar_5
Honored Contributor

Re: Show the name of the program to which each socket belongs

You can use lsof tool to get process ID which is using socket.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Show the name of the program to which each socket belongs

Use this.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=238432


Install lsof tool from,

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.75/

and try as,

# lsof -i tcp:

--
Muthu
Easy to suggest when don't know about the problem!
Mustafa Gulercan
Respected Contributor

Re: Show the name of the program to which each socket belongs

hi;

#netstat -a | grep LISTEN

regards,

mustafa
Arunvijai_4
Honored Contributor

Re: Show the name of the program to which each socket belongs

Hello,

"lsof" is the command you are looking for.. You can download and install from,

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

You can use as,
# lsof -i tcp:
# lsof -i udp:

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"