Monday, December 12, 2011

How to find a process listening on Particular Port ?

HI All

We must have encountered issues related to port conflicts.When you are trying to start a jvm you see the port which jvm uses has been occupied by some other process. So to Identify th process who has occupied this port here are some basic commands:

AIX
1)lsof
lsof -i|grep port number

2)netstat -Aan|grep port number
rmsock tcpcb (this must be run as root)






3)on Windows

netstat -nao |grep port number 


3 comments:

sreedhar said...

i have run netstat -ano | grep 86.

i got the out put like...

TCP 10.19.13.118.252:4086 10.19.13.118.252:3081 LISTENING 6728

But on PID 6728 no process has shown in task manager.

TechnoTips said...

HI Sreedhar for sure that will be the process id.
please tick the checkbox "show process from all users" there you will find the process id (may be the process is being run by some other user).

suvashan said...

Good information's anand ...
thanks for sharing it ...