sudo(8) netstat(8) -atpn
execute a command as another user
Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
-a, --all
    Show  both  listening  and non-listening sockets.  With the --interfaces option, show interfaces that are
    not up
-p, --program
    Show the PID and name of the program to which each socket belongs.
--numeric , -n
    Show numerical addresses instead of trying to determine symbolic host, port or user names.
source manpages: sudonetstat