netstat

Display network connections, routing tables, and interface statistics.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

netstat is the classic network diagnostics tool. On modern Linux systems `ss` is preferred — faster and more accurate. -tulnp shows all listening services with process info.

Common flags
FlagMeaning
-tTCP connections
-uUDP connections
-lListening sockets only
-nNumeric addresses (no DNS)
-pShow process name and PID
Examples
netstat -tulnpShow all listening TCP/UDP services with PIDs · explain & risk-check →
netstat -rnDisplay kernel routing table numerically · explain & risk-check →
Pro tip

`ss` is the modern replacement for `netstat`. Add `alias netstat='ss'` to your ~/.bashrc to build the habit.

Related
ss ip route lsof nmap
Open the full explainer →More in Networking

Reference text is hand-written and may be incomplete — check man netstat for your version. Test destructive commands on a non-production system first.