Netstat
Commands are used to display various network-related information, such as network connections, routing tables, Interface states (Interface Statistics), masquerade connections, multicast members (multicast memberships), and so on.
The output can be divided into two parts, an n active Internet connections, an active TCP connection, and a format of
| Proto |
Recv-q |
Send-q |
Local Address |
Foreign Address |
| Agreement |
Accept Queue |
Send Queue |
Local address Ip:port |
Request Address Ip:port |
There is also an active domain socket, active UNIX domain socket interface, only for local communication, but very high performance
| Command Parameters |
function |
| -A |
(all) Show all options, default does not show listen related |
| -T |
(TCP) shows only TCP-related options |
| -U |
(UDP) show only UDP-related options |
| -N |
Refuse to display aliases, which can show all the numbers converted into numbers. |
| -L |
List only service statuses that are in Listen (listening) |
| -P |
Shows the name of the program that established the related link |
| -R |
Show routing information, routing table |
| -E |
Display extended information, such as UID, etc. |
| -S |
Statistics according to each protocol |
| -C |
Every other fixed time, execute the netstat command. |
Instance:
| List all ports |
netstat-a |
| List all TCP ports |
Netstat-at |
| List all UDP ports |
Netstat-au |
| Show only listening ports |
Netstat-l |
| List all listening TCP only |
Port Netstat-lt |
| List all listening UDP only |
Port Netstat-lu |
| Show statistics for all ports |
Netstat-s |
| Show PID and process name in netstat output |
Netstat-p |
| Display statistics for TCP or UDP ports |
Netstat-st or-su |
| Listening for a process on a network port |
Netstat-lntp |
netstat command small note