The command netstat

This command, available on Unix and Windows, lists established connections by trying to replace IP addresses with DNS names and port numbers with their name. But there are several switches that can change its behavior:

On Unix, the three switches can be combined, which gives:

netstat -n -a -p

The command can also be written as:

netstat -nap