Netstat Cheat Sheet | JR Academy


title: Netstat date: 2021-01-27 11:44:21 background: bg-slate-700 tags: - network - utility - port categories: - Linux Command intro: | This quick reference cheat sheet provides various for using netstat command. plugins: - copyCode

Getting Started

Statistics

All connections on port 80

$ netstat -anp | grep :80

Netstat Help

$ netstat -h

Listening

OptionExample
netstat -ltunpAll Listening ports
netstat -ltnListening TCP ports
netstat -lunListening UDP ports
netstat -lxListening Unix ports

Connections

OptionExample
netstat -aAll connections
netstat -atAll TCP connections
netstat -auAll UDP connections

Statistics

OptionExample
netstat -sDisplay statistics
netstat -stDisplay TCP statistics
netstat -suDisplay UDP statistics

Networks

OptionExample
netstat -iShow network interfaces
netstat -ieShow network interfaces extended info

Routing

OptionExample
netstat -rShow routing table
netstat -rnShow routing table, don't resolve hosts