Display network connections, routing tables, and interface statistics.
low risk
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.
| Flag | Meaning |
|---|---|
-t | TCP connections |
-u | UDP connections |
-l | Listening sockets only |
-n | Numeric addresses (no DNS) |
-p | Show process name and PID |
netstat -tulnpShow all listening TCP/UDP services with PIDs · explain & risk-check →netstat -rnDisplay kernel routing table numerically · explain & risk-check →`ss` is the modern replacement for `netstat`. Add `alias netstat='ss'` to your ~/.bashrc to build the habit.
Reference text is hand-written and may be incomplete — check man netstat for your version. Test destructive commands on a non-production system first.