Operating System - HP-UX
1753767 Members
5656 Online
108799 Solutions
New Discussion юеВ

Re: socket verification commands

 
SOLVED
Go to solution
Shivkumar
Super Advisor

socket verification commands

Is there a command to check how many sockets are being opened by a particular process ?

Can we kill or close open sockets ? If yes; what is the command for this ?

Thanks,
Shiv

5 REPLIES 5
Mel Burslan
Honored Contributor
Solution

Re: socket verification commands

Command you are looking for is

lsof -U

if you do not have lsof, you can get it from

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

and last but not the least, I do not know any other way to close a socket other than killing the process who opened it if we are talking to do it from the unix command line. Otherwise, sockets are accesible for open and close for the applications. They close the socket by a close() system call as far as my limited system programming knowledge goes. It is not an easy process by any means.
________________________________
UNIX because I majored in cryptology...
Devesh Pant_1
Esteemed Contributor

Re: socket verification commands

Shiv,
if you don't have lsof installed you can do a netstat -an
but definitely lsof makes it very easy


thanks
DP
Sandman!
Honored Contributor

Re: socket verification commands

Yes you can close open sockets. You need to use the ndd command for that...man ndd

best of luck!
Sandman!
Honored Contributor

Re: socket verification commands

Mahesh Kumar Malik
Honored Contributor

Re: socket verification commands

Hi Shiv

lsof is contributary utility and can be used to monitor open sockets. You may download its binary from following link:

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

Regards
Mahesh