$netstat
Print network connections, routing tables, interface statistics, and listening ports.
netstat [OPTIONS]Try `netstat` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
Overview & How netstat Works
`netstat` (Network Statistics) provides comprehensive visibility into incoming and outgoing network connections, listening TCP/UDP ports, routing tables, and interface metrics.
Common Flags & Command Options
| Flag / Option | Description |
|---|---|
| -t | Display TCP network connections. |
| -u | Display UDP network connections. |
| -l | Show only listening server sockets. |
| -p | Show the PID and program name to which each socket belongs. |
| -n | Show numerical addresses and port numbers instead of resolving hostnames. |
Practical Real-World Examples
netstat -tulnLists all open TCP and UDP ports in numeric format.
Frequently Asked Questions
What is the modern replacement for netstat in newer Linux distributions?
The `ss` (Socket Statistics) command from `iproute2` is the faster, modern successor to `netstat`.
Related Linux Commands
Transfer data from or to a server using HTTP, HTTPS, FTP, and more.
Non-interactive network downloader for HTTP, HTTPS, and FTP.
Send ICMP ECHO_REQUEST to network hosts to test connectivity and latency.
Securely log into remote Linux servers and execute commands over encrypted connections.
Securely copy files and directories between hosts over SSH connection.
Fast and versatile remote and local file-copying and synchronization tool.