Jan
5
netstat -tpe
From Linux magazine sidebar, nice set of switches for netstat:
netstat -tpe
t limits to TCP, p lists PID, and e gives some nice extra stuff (sendq, recvq, username, inode, foreign address looked up via DNS, program name)
You need to be root for some of these to appear. This is my new favorite invocation of netstat (I used to use -anp routinely).