Re: Some real simple questions regarding sockets

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 10/23/03


Date: Thu, 23 Oct 2003 17:53:24 GMT

In article <yw1x8ynbhmu8.fsf@kth.se>, Måns Rullgård <mru@kth.se> wrote:
>nimmi_srivastav@yahoo.com (Nimmi Srivastav) writes:
>
>> What's the best way to know which application is using a certain TCP
>> or UDP port number from the OS shell?
>
>netstat -p

On my Solaris 2.6 system that prints

Net to Media Table
Device IP Address Mask Flags Phys Addr
------ -------------------- --------------- ----- ---------------
le0 router 255.255.255.255 00:04:de:82:cb:57
le0 wob-dhcp177-088 255.255.255.255 00:d0:59:11:b4:15
le0 tools 255.255.255.255 SP 08:00:20:89:c7:c9
le0 base-address.mcast.net 240.0.0.0 SM 01:00:5e:00:00:00

which is the same as "arp -a". This is clearly not what the OP was looking
for.

The answer that works on just about every flavor of Unix is to use "lsof".
If it's not already on your system, it's available for download from a
variety of places (for Sun's, you can get it from www.sunfreeware.com).

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • TCP receive/transmit windows
    ... applications now aday are written to accept TCP packet size at 64kb and ... ODBC Driver for Solaris ... Disk wiping tool ... Sector Last ...
    (SunManagers)
  • TCP & Rcev Window Size Questions
    ... I'm looking for some TCP information. ... Just a Solaris Admin. ... if we perform MGETS with the command line FTP this ... Receive Window size. ...
    (comp.unix.solaris)
  • Re: How do I tell "sh" to automatically switch to bash
    ... statically linked shell which will not be dependent on the dynamic ... Solaris, when properly configured, ... for root or any other account. ... interact with production boxes at work all day long but I also ...
    (comp.unix.solaris)
  • Re: Backspace
    ... But actually I'm using Bourne shell on FreeBSD 6.1 just like the ... Solaris in lab, and the FreeBSD is freshly installed, I have checked ... I think Solaris was just like the above. ... shells in UNIX environments have startup files to customize the key ...
    (freebsd-questions)
  • Re: Remote Desktop problems outside my network
    ... "The forwarding on the old firmware had individual settings for TCP and UDP. ... Early on, ie. XP SP1 days and earlier, some folks with audio redirection issues needed UDP Port 3389. ...
    (microsoft.public.windowsxp.work_remotely)