netstat Cheat Sheet
The classic network statistics tool — sockets, routes, and interfaces on legacy systems still running it.
Networking2 sections · 9 commands
⌘K
Sockets
5netstat -tulpnListening TCP/UDP with PID/program
netstat -anAll sockets, numeric, no resolve
netstat -tnp | grep :80Active TCP on a port
netstat -taTCP with states (listening+established)
netstat -an | awk '{print $6}' | sort | uniq -cConnection counts by state
Routes & Interfaces
4netstat -rnRouting table, numeric
netstat -iInterface stats (errors, drops)
netstat -sProtocol statistics
netstat -stTCP statistics only