netstat command in Linux

Tips & Tweaks

Many of Linux users would be curious to know about the nestat command. The command "nestat" displays statistical information and the current state of network connections, protocols, ports / sockets and appliances. The following is the syntax :

netstat [options]

The following are the options :

-S displays statistical information about the protocols.

-I displays statistical information about the network interface.

-R displays the routing table.

-C displays statistical information and updates every second

-L displays information about all sockets that are ready to listen.

-A displays information about all sockets that are ready to listen and not listen.

You can see the status of network connections by listing the sockets open. This is the default option: if you do not specify address family, active sockets of all families address will be displayed. With the parameter-e you get some additional information (userid). With the parameter-v you can ask netstat report address families known not supported by the kernel. The-o parameter displays additional information on network timers. By giving -p you will see the PID and process name that owns socket. The-a displays all sockets, including listening socket servers. The address family inet displays Raw sockets, udp and tcp.