Quick question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Quick question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Quick question  
tvr


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Hi,

Is there any command to know which application/program is listening
on a given socket.

For example, some daemons are running on the current system.
I want to know what application is listening on socket 1234.

Is this possible??

Thanks in advance.
tvr1729





[ Post a follow-up to this message ]



    Re: Quick question  
Bit Twister


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

On 15 Nov 2003 18:21:06 -0800, tvr wrote:
quote:
> Hi, > > Is there any command to know which application/program is listening > on a given socket. > > For example, some daemons are running on the current system. > I want to know what application is listening on socket 1234. > > Is this possible??
netstat -ta # maybe




[ Post a follow-up to this message ]



    Re: Quick question  
tvr


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Bit Twister <BitTwister@localhost.localdomain> wrote in message news:<slrnbrdnoi.6ks.BitTwister@wb
.home>...
quote:
> On 15 Nov 2003 18:21:06 -0800, tvr wrote: > > > netstat -ta # maybe
Nestat displays all the ports... I want a specific port. tvr




[ Post a follow-up to this message ]



    Re: Quick question  
Bit Twister


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

On 16 Nov 2003 18:20:02 -0800, tvr wrote:
quote:
> > Nestat displays all the ports... > I want a specific port.
Then pipe it through grep.




[ Post a follow-up to this message ]



    Re: Quick question  
Andrew Jury


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Hi,

Try the Open Source command 'lsof'. If you don't have it get it here:

http://freshmeat.net/projects/lsof/

If you are working on Solaris 5.8 > then 'pfiles' is a good choice, however
you will have to filter the output to get the info you need in this case.

--- aj ---

"tvr" <tvr1729@yahoo.com> wrote in message
news:6f4d9f70.0311151821.1cd060bd@posting.google.com...
quote:
> Hi, > > Is there any command to know which application/program is listening > on a given socket. > > For example, some daemons are running on the current system. > I want to know what application is listening on socket 1234. > > Is this possible?? > > Thanks in advance. > tvr1729




[ Post a follow-up to this message ]



    Re: Quick question  
Ulrich Herbst


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

tvr1729@yahoo.com (tvr) writes:
quote:
> Bit Twister <BitTwister@localhost.localdomain> wrote in message news:<slrn brdnoi.6ks.BitTwister@wb.home>... > > Nestat displays all the ports... > I want a specific port. >
Use netstat -ta | grep xxx But I think that is different for different Unixes. For Linux, that is netstat -anp | grep 1234 and you can just list your own processes or you have to be root. There are some unixes without such a command. Install and try lsof or fuser. Uli -- ''' (0 0) +------oOO----(_)--------------+ | | | Ulrich Herbst | | | | Tel. ++49-7271-940775 | | | | Ulrich.Herbst@gmx.de | +-------------------oOO--------+ |__|__| || || ooO Ooo




[ Post a follow-up to this message ]



    Re: Quick question  
tvr


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

Ulrich Herbst <ulrich.herbst@gmx.de> wrote in message news:<877k1zgc2h.fsf@pculi.herbst.fam>...[QU
OTE]
> tvr1729@yahoo.com (tvr) writes:
> 
> Use netstat -ta | grep xxx
>
> But I think that is different for different Unixes.
>
> For Linux, that is netstat -anp | grep 1234
> and you can just list your own processes or you have to be root.
>
> There are some unixes without such a command.
>
> Install and try lsof or fuser.
>
> Uli
>[/QUOTE]

Guys,

I am familiar with piping and tried that earlier.
Netstat give some stream information
but not the actual process that is listening.

I dont know about others but in solaris it is giving out stream information
for example:

host:~ > netstat -a | grep 8001
3003c3ba8d8 stream-ord 300116d0e50 00000000 8001

So you see, I cant make out what the process is.

Anyway, thanks for the replies
tvr





[ Post a follow-up to this message ]



    Re: Quick question  
Flip


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

> So you see, I cant make out what the process is.
I'm a newbie to linux so maybe I'm off the mark here, but I found the -p
returns the name of the program on that port.  It seems like you netstat
installed cause you're getting stuff back, what do the man pages say for
programs?







[ Post a follow-up to this message ]



    Re: Quick question  
tvr


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

"Flip" <[remove]phenry_w@hotmail.com> wrote in message news:<eP4vb.5658$G1.26726@tor-nn1.netcom.ca>...[QUO
TE] 
> I'm a newbie to linux so maybe I'm off the mark here, but I found the -p
> returns the name of the program on that port.  It seems like you netstat
> installed cause you're getting stuff back, what do the man pages say for
> programs?[/QUOTE]


Man pages say,
-p    is used to "Show the net to media tables."

Thanks
tvr





[ Post a follow-up to this message ]



    Re: Quick question  
Andy Hibbins


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:54 PM

tvr wrote:
quote:
> Man pages say, > -p is used to "Show the net to media tables."
Have you got lsof? If so this may show what program is using the socket you mention, "lsof -n -i" may be what you need. --- Money can't buy happiness, but allows a choice of misery.




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register