The netstat command is used to print the status information of network systems in Linux, allowing you to know the network conditions of the entire Linux system.
-A or--all: Displays all sockets in the connection,-a< network type > or--< network type;: Lists the relevant addresses in the network type connection;-C or--continuous: The network status is continuously listed; C or--cache: Displays the cache information for the router configuration,-E or--extend: Displays other relevant information about the network;-F or--fib: Show fib,-G or--groups: Displays the multi-broadcast feature group members list;-H or--help: online help; I or--interfaces: Displays the network interface information form;-L or--listening: Displays the socket of the server in the monitor,-M or--masquerade: Displays the spoofed network connection,-N or--numeric: Use the IP address directly, Instead of through the domain name server,-N or--netlink or--symbolic: Displays the symbolic connection name of the network hardware peripheral device,-O or--timers: Display timer,-P or--programs: shows the program identification code and program name of the socket being used; R or--route: Displays routing Table;-S or--statistice: Displays the statistics of the network work information;-T or--tcp: shows the connection status of the TCP transport protocol;-U or--UDP: Displays the connection status of the UDP transport protocol; V or--verbose: Displays the instruction execution process,-V or--version: Displays version information,-W or--raw: Displays the connection status of the raw transport protocol,-X or--unix: The effect of this parameter is the same as specifying the "-A unix" parameter;-- IP or--inet: The effect of this parameter is the same as specifying the "-A inet" parameter.
List all ports (both listening and not listening)
Netstat--
List all Sockets in the listening state
netstat---
Show statistics for each protocol
Netstat---SU displays statistics for UDP ports
IP and TCP analysis view the IP addresses that connect to a service port:
grep :awk'{print $}'cutawk ' {++ip[$1]} END {for (i-in IP) print ip[i], "\ t", I} ' Sort
TCP Various status lists:
grep 127.0. 0.1 0.0. 0.0 awk ' /^tcp/{++state[$NF]} END {for (I-in state) print I, "\ T", State[i]} '
View the number of phpcgi processes, and if they are close to the preset, they are not enough and need to be increased:
grep " php-cgi " WC -L
The Netstat of Linux commands