Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whereas on Windows it's possible to use Netstat -b, which tells you what connections are open and what program has each one open, on the Mac it seems that Netstat does not allow this.

Is there another way to get this information if Netstat isn't the tool for that job?

share|improve this question
up vote 3 down vote accepted
> lsof -i :58199
Transmiss 304 Fyodor    8u  IPv4 0x2fbc34fe135e3895      0t0  UDP *:58199

lsof = list open files. See manual for more details.


You can see with "ps -ef" more info about the PID "lsof" gave you.

share|improve this answer
You can use lsof -i in Terminal to you see all open network connections. – Fyodor Sep 16 '12 at 15:22
No, what I'm saying is that lsof -i is failing to show one of the connections that Netstat is showing. – Asker Sep 16 '12 at 23:59
@Mithras Could the vanishing connection be one netstat is using to do its thing and lsof -i doesn't see it be cause ti no longer exists? Try running them at the same time. – CajunLuke Sep 20 '12 at 14:55
The connection has to do with accessing Apple's servers: st11p01st-courier... – Asker Oct 31 '12 at 22:28

To get the pid associated with each socket on OS X use the -v option for netstat

$ netstat -avnp tcp
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)     rhiwat shiwat    pid   pid
tcp6       0      0  *.3689                 *.*                    LISTEN      131072 131072   7541      0
tcp4       0      0  *.3689                 *.*                    LISTEN      131072 131072   7541      0
tcp46      0      0  *.3283                 *.*                    LISTEN      131072 131072    631      0
tcp4       0      0  *.88                   *.*                    LISTEN      131072 131072     87      0
tcp6       0      0  *.88                   *.*                    LISTEN      131072 131072     87      0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.