Ritesh’s Technical Blog

The Netstat Command

Posted on: July 31, 2008

The Netstat Command

Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.

Syntax

netstat [-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]

Switches:

-A Shows the addresses of any associated protocol control blocks.

-a Will show the status of all sockets. Sockets associated with network

server processes are normally not shown.

-I Shows the state of the network interfaces.

-m Prints the network memory usage.

n Causes netstat to show actual addresses as opposed to hostnames or

network names.

r Prints the routing table.

s Tells netstat to show the per protocol statistics.

t Replaces the queue length information with timer information.

Examples

To display both the Ethernet statistics and the statistics for all protocols, type the following command:

netstat -e -s

To display the statistics for only the TCP and UDP protocols, type the following command:

netstat -s -p tcp udp

To display active TCP connections and the process IDs every 5 seconds, type the following command:

nbtstat -o 5

To display active TCP connections and the process IDs using numerical form, type the following command:

nbtstat -n -o

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

Blog Stats

  • 55,046 hits
%d bloggers like this: