Netstat Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。
All connections on port 80
$ netstat -anp | grep :80
Netstat Help
$ netstat -h
| Option | Example |
|---|---|
netstat -ltunp | All Listening ports |
netstat -ltn | Listening TCP ports |
netstat -lun | Listening UDP ports |
netstat -lx | Listening Unix ports |
| Option | Example |
|---|---|
netstat -a | All connections |
netstat -at | All TCP connections |
netstat -au | All UDP connections |
| Option | Example |
|---|---|
netstat -s | Display statistics |
netstat -st | Display TCP statistics |
netstat -su | Display UDP statistics |
| Option | Example |
|---|---|
netstat -i | Show network interfaces |
netstat -ie | Show network interfaces extended info |
| Option | Example |
|---|---|
netstat -r | Show routing table |
netstat -rn | Show routing table, don't resolve hosts |