What to you use as a "fuser -v -n tcp" alternative on Mac OS X
As @vcsjones said in the comments, lsof
is the tool for this:
$ sudo lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Safari 804 gordon 16u IPv4 0x05a2cec8 0t0 TCP 192.168.6.3:50542->stackoverflow.com:http (ESTABLISHED)
httpd 874 root 3u IPv6 0x05a2a940 0t0 TCP *:http (LISTEN)
httpd 878 _www 3u IPv6 0x05a2a940 0t0 TCP *:http (LISTEN)
Without the -i
, it shows all open files; with just -i
it shows network files only; if you specify something after the -i
you can restrict by any or all of: IPv4/6, TCP/UDP, hostname or IP, and port number/service name.