Who’s LISTENing?
January 22nd, 2008 by ravi

Sometimes its useful to know who’s LISTENing on a socket. On GNU/Linux and similar systems, the command netstat -lp provides a listing of all sockets on which processes on your system are listening for connections, along with the process IDs/names of these processes. Unfortunately, it seems the MacOS (Leopard) version of netstat does not support the -p option. Fortunatly, Leopard does come with that Swiss army knife of process and file info, lsof, which among other things can display socket info.

For instance, to find the process that was listening on port 3000 on my system, I used: lsof -i 4:3000. The -i arg is used to specify the type of socket/connection we are looking for, the 4 denotes IPv4 and the 3000 is of course the port we are interested in.


Leave a Reply


While I love to hear (read) your comments, if you are looking specifically for help with one of my software projects (such as my WordPress themes), please do not add a comment here, but instead click on the link below: Using that link, you might even find a previous report of (and solution for) the issue!
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">




SIDEBAR
»
S
I
D
E
B
A
R
«
»  Substance:WordPress   »  Style:Ahren Ahimsa