netstat

netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.


Show all ports

netstat -a

Show all tcp ports

netstat -at

Show all udp ports

netstat -au

Show only listening ports

netstat -l

Show only listening TCP ports

netstat -lt

Show only listening UDP Ports

netstat -lu

Show statistics for all ports

netstat -s

Show the PID and name of the program to which each socket belongs

netstat -p

Show numerical addresses instead of trying to determine symbolic host, port or user names.

netstat -n

Display the kernel routing information

netstat -r

Show all network interfaces

netstat -i

Display extended information on the interfaces

netstat -ie