Netstat is a useful command line utility that can display very detailed information about network connections, routing information and a lot of useful statistics.
This utility is available in both Unix/Linux, Windows and MacOSX (Based on Unix).
To run it open a console (command prompt, terminal) and enter the following short command:
netstat
This will provide some default information to give you the basic idea of what this tool does.
Netstat has a host of useful parameters which can arrange the representation of data or provide even more information
netstat -a
This parameter will display active and listening connections.
netstat -n
This would provide you information with IP addresses in the place of resolved names whenever possible.
netstat -n -b
This combination would provide you the ip addresses and associated program and Process ID of programs along with their corresponding connections
This command is useful for diagnosing a lot of problems. Also, its invaluable for investigating a program's behavior. For more information, you can read further about this from
Netstat - Wikipedia, the free encyclopedia.