Since I always, ALWAYS forget this, here’s the command to find the process which is holding open, say, port 1900 on osx:
$ lsof -i -P | grep 1900 uTorrent 50937 sho 13u IPv4 0xaf49b10 0t0 UDP 10.1.1.8:1900
Fucking uTorrent, why the hell is it sitting on 1900? That’s the SSDP/UPnP server-side port, ie. the router should be listening on 1900. Unless it’s planning on advertising SSDP services it can provide, it doesn’t need that port. Wonder what it’s doing.
Oh btw it only shows your processes, sudo
if you wanna see ‘em all.