Solved

Which process is using the port?

Posted on 2006-07-22
3
1,665 Views
Last Modified: 2013-12-27
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?
0
Comment
Question by:rohit_kapil
3 Comments
 
LVL 10

Expert Comment

by:Nukfror
ID: 17161383
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.
0
 
LVL 5

Expert Comment

by:devrick0
ID: 17162810
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
0
 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
ID: 17164831
You can use my script in http:Unix/Q_21151689.html#12196145 
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question