显示协议统计信息和当前 TCP/IP 网络连接。


NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]


  -a            显示所有连接和监听端口。

  -b            显示包含于创建每个连接或监听端口的可执行组件。在某些情况下已知可执行组件拥有多个独立组件,并且在这些情况下包含于创建连接或监听端口的组件序列被显示。这种情况下,可执行组件名在底部的 [] 中,顶部是其调用的组件,等等,直到 TCP/IP 部分。注意此选项可能需要很长时间,如果没有足够权限可能失败。

  -e            显示以太网统计信息。此选项可以与 -s选项组合使用。

  -n            以数字形式显示地址和端口号。

  -o            显示与每个连接相关的所属进程 ID

  -p proto      显示 proto 指定的协议的连接;proto 可以是下列协议之一: TCPUDPTCPv6 UDPv6

                如果与 -s 选项一起使用以显示按协议统计信息,proto 可以是下列协议之一: IPIPv6ICMPICMPv6TCPTCPv6UDP UDPv6

  -r            显示路由表。

  -s            显示按协议统计信息。默认地,显示 IP

                IPv6ICMPICMPv6TCPTCPv6UDP UDPv6 的统计信息;

                -p 选项用于指定默认情况的子集。

  -v            -b 选项一起使用时将显示包含于为所有可执行组件创建连接或监听端口的组件。

  interval      重新显示选定统计信息,每次显示之间暂停时间间隔(以秒计)。按 CTRL+C 停止重新显示统计信息。如果省略,netstat 显示当前配置信息(只显示一次)



Displays protocol statistics and current TCP/IP network connections.


NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]


  -a            Displays all connections and listening ports.

  -b            Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called,and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.

  -e            Displays Ethernet statistics. This may be combined with the -s option.

  -n            Displays addresses and port numbers in numerical form.

  -o            Displays the owning process ID associated with each connection.

  -p proto      Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP, TCPv6, or UDPv6.  If used with the -s option to display per-protocol tatistics, proto may be any of: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.

  -r            Displays the routing table.

  -s            Displays per-protocol statistics.  By default, statistics are shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;the -p option may be used to specify a subset of the default.

  -v            When used in conjunction with -b, will display sequence of components involved in creating the connection or listening port for all executables.

  interval      Redisplays selected statistics, pausing interval seconds between each display.  Press CTRL+C to stop redisplaying statistics.  If omitted, netstat will print the current

                configuration information once.