please try

lsof -i tcp:<port number>

this should give the port number..

Rgs,
selva

--- Stoyan Angelov <[EMAIL PROTECTED]> wrote:

> John Dunn wrote:
> > I want to check whether a port is in use and by
> what process on Solaris
> > 10(Sparc).
> > 
> > I have lsof installed, but cannot seem to get the
> info I need.
> > What lsof options do I need to use?
> > 
> > John
> > 
> 
> hello John,
> 
> as Romeo mentions you could use netstat to find if
> the port is used - 
> additionally you may also use lsof like this:
> 
> [EMAIL PROTECTED]:~]$lsof -i :5000
> [EMAIL PROTECTED]:~]$echo $?
> 1
> 
> if the port is not use nothing gets printed and the
> exit return code in 
> not 0.
> 
> if the port is used:
> 
> [EMAIL PROTECTED]:~]$lsof -i :177
> COMMAND PID USER   FD   TYPE     DEVICE SIZE/OFF
> NODE NAME
> dtlogin 559 root    5u  IPv6 0xd46c6580      0t0 
> UDP *:177 (Idle)
> [EMAIL PROTECTED]:~]$echo $?
> 0
> 
> greetings,
> 
> Stoyan
> 
> 
> _______________________________________________
> Solaris-Users mailing list
> [email protected]
>
http://www.filibeto.org/mailman/listinfo/solaris-users
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Solaris-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/solaris-users

Reply via email to