Aug 02 2009

OS X process ID and open ports

Published by at 10:57 pm under OS X / Apple OS

I had a need to identify what process ID (PID) on my MacBook running OSX that had a specific IP address and port open so that I could kill it. It took me a while to figure this out but eventually I found something that worked. “-P” stops lsof from translating port number to names e.g. 80 to http.

lsof -i -P

This will show you

COMMAND     PID     USER        FD   TYPE  DEVICE     SIZE/OFF  NODE  NAME
Microsoft   280     someuser    15u  IPv4  0x8862e64       0t0  TCP   *:3546 (LISTEN)
...

No responses yet

Leave a Reply