The program is installed under /usr/bin/netstat
. If it is called without options or with the -h or -? option, the following help text is shown:
netstat [-a][-ia][-h][-i [<ifname>[,...]]][-ir [<ifname>[,...]]][-is] [-isr][-d][-dsr][-g][-gm][-m][-ma][-mn][-mo][-mp][-r][-s][-si][-sc] [-st][-su][-t][-tl][-te][-tpo][-tw][-ac][-u][-?] [<waittime>][<repetitions>]
Description of the options
You can specify several options at the same time. The corresponding outputs are shown for every repetition.
-a | Show IP addresses. |
-ia | Show own IP/IPv6 internet addresses. |
-h | Show this help. |
-i [<ifname>[,...]]: | |
Show interface values. | |
-ir [<ifname>[,...]]: | |
Show interface rate. | |
-is | Show sum of all interfaces. |
-isr | Show sum interface rate of all interfaces. |
-d | Show device connections. |
-dsr | Show sum device rate of all devices. |
-g | show global information in BCAM. |
-gm | show memory information in BCAM. |
-m | Show MAC addresses. |
-ma | Show all MAC addresses. |
-mn | Show all MAC addresses and all their corresponding IP addresses. |
-mo | Show own MAC addresses. |
-mp | Show partner MAC addresses. |
-r | Show routing information. |
-s | Show ICMP, IP, TCP and UDP statistics. |
-si | Show IP statistics. |
-sc | Show ICM statistics. |
-st | Show TCP statistics. |
-su | Show UDP statistics. |
-t | Show TCP connections. |
-tl | Show TCP connections in state "listen". |
-te | Show TCP connections in state "established". |
-tpo | Show own proxy (tunnel) TCP connection, if available. |
-tw | Show TCP connections in state "timewait". |
-ac | Show all TCP connections. |
-u | Show opened UDP ports. |
-? | Show this help |
<waittime> | |
Wait time (in seconds) between 2 displays of the selected functions. | |
<repetitions> | |
Number of times the display of the selected functions is repeated. |
If you don’t specify the <waittime> parameter or the <repetitions> parameter, a display is shown and the program is terminated.
If you only specify the <waittime> parameter, the selected functions are output until the program is aborted (with @@C).
If you also specify the <repetitions> parameter, the program is terminated after the corresponding number of repetitions.