netstat displays network statistics — active connections, listening ports, routing tables, and interface statistics.
Common flags
netstat -natup-n— Show numerical addresses instead of resolving hostnames-a— Show all sockets (listening and established)-t— TCP connections only-u— UDP connections only-p— Show the process/PID associated with each socket
netstat -iShows a table of per-interface network statistics (packets sent/received, errors, drops).