Link to home
Start Free TrialLog in
Avatar of rohit_kapil
rohit_kapil

asked on

Which process is using the port?

How can i find id of a process listening on a specific port.

e.g
I do a nestat on my sytem

> netstat -an | grep 10886
10.234.52.64.10886         *.*                0      0 49152      0 LISTEN


How can I know what process id is using port 10886?
Avatar of Nukfror
Nukfror
Flag of United States of America image

The easiest way to figure this out is to install lsof.  You can get it from either www.blastwave.org or www.sunfreeware.com.  

If you're on Solaris 10, pfiles finally the ability to show clearly what network ports a specific application has open.  The issue is you need to run pfiles against every PID on the system to figure out which app has a port open.
Avatar of devrick0
devrick0

Yeh, with previous versions of solaris, the cleanest way short of developing a script, is to use:
lsof -i:portnumber

so to check for PIDs associated with ssh (assuming you're running it on the default port):
lsof -i:22
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial