netstat

NAME

netstat - show protocol statistics and current TCP/IP network connections

SYNOPSIS

netstat [-a] [-e] [-n] [-s] [-p protocols] [-r] [interval]

DESCRIPTION

Displays active Transmission Control Protocol (TCP) connections, ports on which the computer is listening, Ethernet statistics, the Internet Protocol (IP) routing table, and IP statistics (for the IP, Internet Control Message Protocol [ICMP], TCP, and User Datagram Protocol [UDP] protocols). Used without parameters, netstat(1) displays active TCP connections.

The options are as follows:

-a
Displays all connections and listening ports.
-e
Displays Ethernet statistics. This can be combined with the -s option.
-n
Displays addresses and port numbers in numerical form.
-p protocol
Shows connections for the specified protocol, which can be TCP or UDP. If used with the -s option to display per-protocol statistics, protocol can be TCP, UDP, or IP.
-r
Displays the routing table.
-s
Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p option can be used to specify a subset of the default.
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.

HISTORY

The netstat(1) command appeared in 4.2BSD. IPv6 support was added by the WIDE/KAME project.

SEE ALSO

nfsstat

ps(1)

hosts(5)