From man netstat
:
-p, --program
Show the PID and name of the program to which each socket belongs.
By adding the -p
option, you'll get the PIDs of the programs listening. That's fairly enough to use ps
afterwards :
ps -ef | grep [your-pid]
Not sure if your question is programming-specific though. I would recommend Unix & Linux, or Server Fault (among others).