Netstat Unix
Netstat Unix
by SathiyaMoorthy on March 29, 2010 Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc., In this article, let us review 10 practical unix netstat command examples.
State LISTEN
Path /tmp/.X11-
State
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address tcp 0 0 localhost:ipp tcp6 0 0 localhost:ipp udp 0 0 *:49119
State
Show statistics for TCP (or) UDP ports using netstat -st (or) -su
# netstat -st # netstat -su
State
If you dont want only any one of those three items ( ports, or hosts, or users ) to be resolved, use following commands.
# netsat -a --numeric-ports # netsat -a --numeric-hosts # netsat -a --numeric-users
Flags U U UG
MSS Window 0 0 0 0 0 0
irtt 0 0 0
Note: Use netstat -rn to display routes in numeric format without resolving for host-names.
Display extended information on the interfaces (similar to ifconfig) using netstat -ie:
# netstat -ie Kernel Interface table eth0 Link encap:Ethernet HWaddr 00:10:40:11:11:11 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Memory:f6ae0000-f6b00000