Linux Commands Helper
💬 Your AI-powered Linux assistant
netstat Command - Network Statistics
The netstat command is used to display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. It is a useful tool for network troubleshooting and monitoring.
Syntax
netstat [options]
Examples
netstat -tuln
Show all listening ports (TCP and UDP) with numeric addresses.
netstat -anp
Display all connections and listening ports with process IDs.
netstat -r
Show the kernel routing table.
netstat -i
Display a table of all network interfaces.
Notes
- Some options may require root privileges to display all information.
- On modern Linux systems,
ss
is recommended as a replacement fornetstat
. net-tools
package may need to be installed to usenetstat
on some distributions.