Luoluo cow once again showed me his strong Linux ability, now summed up the use of netstat.
First, look at Netstat's man page:
NAME
Netstat-print network connections, routing tables, interface statistics, masquerade connections, and multicast Membershi Ps
As you can see, the netstat command can print network connections, routing tables, interface statistics, camouflage links, and multicast members.
Synopsis
netstat [--all|-a] [--numeric|-n] [--tcp|-t] [--udp|-u] [--listening|-l] [--program|-p] [--statistics|-s] [--help|-h]
Parameter explanation:
NETSTAT-A: Show socket status in all connections and waiting
Netstat-n: When the network state is displayed, the address is represented as a number (as localhost expressed as 127.0.0.1)
Netstat-s: Network statistics by network protocol classification display
NETSTAT-T: Show TCP protocol network status
Netstat-u: Displaying UDP protocol network status
Netstat-p: Show Process Name
Common combinations:
1.netstat-an (Listing all the listening Ports of TCP and UDP connections)
2.netstat-at (Listing only TCP (Transmission control Protocol) port connections using Netstat-at.)
3.netstat-l (Listing all active listening ports connections with netstat-l.)
4.NETSTAT-TP (displaying service name with their PID number, using option NETSTAT-TP would display "Pid/program name".)
Reference:
http://www.tecmint.com/20-netstat-commands-for-linux-network-management/
http://write.blog.csdn.net/postedit/17555445