Solved

Which process is using the port?

Posted on 2006-07-22
3
1,662 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now