In computing, netstat
(network statistics) is a command-line network utility tool that displays network connections for the (both incoming and outgoing), routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics. It is available on Unix-like operating systems including macOS, Linux, Solaris, and BSD, and is available on Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.
It is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement.
On Linux, netstat (part of "net-tools") is superseded by ss (part of iproute2), which is recommended instead.
Parameters used with this command must be prefixed with a hyphen (-) rather than a slash (/). If a parameter is supported only on some platform or platforms, the platform or platforms is listed in parentheses after the parameter.
Netstat provides statistics for the following:
To display the statistics for only the TCP or UDP protocols, type one of the following commands:
netstat -sp tcp
netstat -sp udp
On Unix-like systems:
netstat -aop | grep "pid"
sudo netstat -nutpacw