Netstat used to display various network related information, such as network connection, routing table, interface status (Interface Statistics) , Masquerade Connect, multicast member (Multicast memberships) wait [Email protected]:~$ netstat-h Usage:netstat [-VWEENNCCF] [<af>]-R netstat {-v|--version|-h|--help} netstat [-vwnncaeol] [<socket> ...] netstat {[-vweennac]-I | [-cwnne]-M | -S} -R,--route display routing table # #显示路由表 -I,--interfaces display interface table -G,--groups display multicast group memberships -S,--statistics display networking statistics (like SNMP) displays network statistics -V,--verbose be verbose -W,--wide don ' t truncate IP addresses -N,--numeric don ' t resolve names # #不解析名字, displayed digitally (can see port) --numeric-hosts don ' t resolve host names --numeric-ports don ' t resolve port names --numeric-users don ' t resolve user names -N,--symbolic resolve hardware names -E,--extend display other/more information -P,--programs display pid/program name for sockets # # -C,--continuous continuous listing -L,--listening display listening server sockets -A,--all,--listening display all sockets (default:connected) -O,--timers display timers -F,--FIB display Forwarding information Base (default) -C,--cache display routing cache instead of FIB <SOCKET>={-T|--TCP} {-u|--udp} {-w|--raw} {-x|--unix}--ax25--ipx--netrom <af>=use ' -6|-4 ' or '-A <af> ' or '--<af> '; Default:inet List of possible address families (which support routing): inet (DARPA Internet) Inet6 (IPV6) ax25 (Ampr ax.25) Netrom (AMPR Net/rom) IPX (Novell IPX) DDP (Appletalk DDP) X25 (CCITT x.) Reference article http://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316661.html Common parameters -A (all)Show all options, do not display by defaultLISTENrelated -T (TCP)Show OnlyTCPRelated Options -U (UDP)Show OnlyUDPRelated Options -Nrefuse to display aliases, which can show all the numbers converted into numbers. -Llists only theListen (Monitor) The service status - P shows the program name for establishing related links . Span style= "Font-family:segoe UI;" > -R show routing information, routing table -e uid etc. -S statistics according to each protocol Span style= "Font-family:segoe UI;" > -c Every other fixed time, perform the netstat command. Tips: LISTEN and the LISTENING the state is only used -A or - L to see List all TCP ports sudo netstat-at (run as Root) Convert to digital display of sudo NETSTAT-NATP (run as root user) Display 53 port occupancy (in TCP, UDP-L displays the sockets that is listening) Display 53 port occupancy (show all connections) List all connection conditions (and show process name) from a holistic perspective, netstat the output can be divided into two parts: one is active Internet connections active tcp " UDP connection , where "recv-q" and " Send-q " Span style= "font-family: the song Body;" The %0a is the receive queue and the send queue. These numbers are generally supposed to be 0 . If not, it means that the package is accumulating in the queue. This situation can only be seen in very few cases. active UNIX domain sockets , called active Span style= "Font-family:segoe UI; Background-color:yellow; " >unix domain Socket interface ( and network sockets , but only for native communication, performance can be increased by one times proto show the protocol used by the connection refcnt represents a process number connected to this set of interfaces Types show type of socket interface State displays the current state of the socket interface Path represents the path name used by other processes that are connected to the socket interface |