Netstat Command Syntax:
netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p protocol] [-r] [-s] [-t] [-x] [-y] [time_interval] [/?]
Tip: See How To Read Command Syntax if you're not sure how to read the netstat command syntaxabove.
Execute the netstat command alone to show a relatively simple list of all active TCP connections which, for each one, will show the local IP address(your computer), the foreign IP address (the other computer or network device), along with their respective port numbers, as well as the TCP state.
-a = This switch displays active TCP connections, TCP connections with the listening state, as well as UDP ports that are being listened to.
-b = This netstat switch is very similar to the -oswitch listed below, but instead of displaying the PID, will display the process's actual file name. Using-b over -o might seem like it's saving you a step or two but using it can sometimes greatly extend the time it takes netstat to fully execute.
-e = Use this switch with the netstat command to show statistics about your network connection. This data includes bytes, unicast packets, non-unicast packets, discards, errors, and unknown protocols received and sent since the connection was established.
-f = The -f switch will force the netstat command to display the Fully Qualified Domain Name(FQDN) for each foreign IP addresses when possible.
-n = Use the -n switch to prevent netstat from attempting to determine host names for foreign IP addresses. Depending on your current network connections, using this switch could considerably reduce the time it takes for netstat to fully execute.
-o = A handy option for many troubleshooting tasks, the -o switch displays the process identifier (PID) associated with each displayed connection. See the example below for more about using netstat -o.
-p = Use the -p switch to show connections or statistics only for a particular protocol. You can not define more than one protocol at once, nor can you execute netstat with -p without