3 Replies Latest reply: Sep 8, 2006 11:23 AM by Nathan Pangburn
jsanchez157 Level 1 Level 1 (0 points)
Is anyone aware of a way of getting the equivalent of "netstat -b" (Windows XP Pro) which lists the binaries associated with their respective ports?
Sample result:
C:\>netstat -b
TCP wxp10168:2786 eg-www.apple.com:http ESTABLISHED 1688
[FIREFOX.EXE]
C:\>

Thanks,
-Jav

Macbook Pro 17, Mac OS X (10.4.7)
  • Nathan Pangburn Level 4 Level 4 (3,920 points)
    There may be other ways to do this, but I always use:

    lsof -i

  • Gary Kerbaugh Level 6 Level 6 (18,040 points)
    Hi Jav,
       There is a netstat command on OS X but it doesn't show the process monitoring the port. As Nathan says, lsof is the ticket. However, when invoked as a regular user, lsof only lists processes owned by that user. In order to check all ports, the command should be run as root via sudo.
    --
    Gary
    ~~~~
       Shift to the left,
       Shift to the right,
       Mask in, mask out,
       BYTE, BYTE, BYTE !!!
  • Nathan Pangburn Level 4 Level 4 (3,920 points)
    Thanks for the clarification, Gary. It may have been confusing to Jav if he did not realize that small, yet very important distinction!