Solved

Which process is using the port?

Posted on 2006-07-22
3
1,673 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

635 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