Name

netstat

Synopsis

netstat [options]

Description

TCP/IP command. Show network status. For all active sockets, print the protocol, the number of bytes waiting to be received, the number of bytes to be sent, the port number, the remote address and port, and the state of the socket.

Options

-a

Show the state of all sockets, not just active ones.

-c

Display information continuously, refreshing once every second.

-i

Include statistics for network devices.

-n

Show network addresses as numbers.

-o

Include additional information such as username.

-r

Show routing tables.

-t

List only TCP sockets.

-u

List only UDP sockets.

-v

Print the version number and exit.

-w

List only raw sockets.

-x

List only Unix domain sockets.

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.