Summary: Searching for a process using a given port

From: Agarkar, Rahul (Rahul_Agarkar@bmc.com)
Date: Fri May 13 2005 - 00:11:02 EDT


Thanks everybody for the overwhelming response. I got a couple of responses
which I have copied below:

1) "You need the open source utility "lsof". The source is available from a
system at Purdue University. Perform a search in Google, and you should
find it."

This is the one which I tried and works fine.
2) "ps -ef |awk {'print $2'} > /tmp/pid.out
for i in `cat /tmp/pid.out`
do

pfiles $i >> /tmp/pfiles.out
done

>From the output file /tmp/pfiles.out, you can use any edit utility or
whatever can view it to search/locate the port you looking for, then you
know which sockets/ports belongs to which processes."

Regards,
- Rahul
 

-----Original Message-----
From: Agarkar, Rahul [mailto:Rahul_Agarkar@bmc.com]
Sent: Friday, May 13, 2005 9:03 AM
To: sunmanagers@sunmanagers.org
Subject: Searching for a process using a given port

Hello,
 
Is there any way I can find out which process is using a given port ? For
example, if I want to find out, which process is connected to port no. 8888,
how can do this ? netstat -na gives information about the host:port
connected to the given port. It does not give any information about the
process (process name or process id) connected to this port.
 
Regards,
- Rahul
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:42 EDT