netstat


netstat -al # show listening sockets

netstat -aop | grep “pid” # all ports open by a process with id pid