cmdxray / commands / netstat

What does netstat do?

show network connections, routing tables, and interface stats.

▸ Explain your own netstat command →

netstat examples, explained

$ netstat -tulpn

  • netstatshow network connections, routing tables, and interface stats
  • -tTCP connections
  • -uUDP connections
  • -lonly listening sockets
  • -pshow the PID and program name for each socket
  • -nnumeric output — don't resolve hosts, ports, or users

$ netstat -rn

  • netstatshow network connections, routing tables, and interface stats
  • -rshow the kernel routing table
  • -nnumeric output — don't resolve hosts, ports, or users

netstat flags & options

-tTCP connections
-uUDP connections
-lonly listening sockets
-pshow the PID and program name for each socket
-nnumeric output — don't resolve hosts, ports, or users
-aall sockets (listening and non-listening)
-rshow the kernel routing table
-eextended information
-sper-protocol summary statistics
-ccontinuously refresh the display

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.