Using the netstat command

The netstat command displays the contents of various network-related data structures for active connections.