NetStat Cheat Sheet

Here is a quick cheat sheet about NetStat that I gathered from the video I share at the bottom of this post. NetStat is a very useful tool for managing system network connection ports among other things.

NetStat Basic Commands

CommandExplanation
netstat –helpHelp
netstat -ieDisplays the Network Interface. Similar to what the ipconfig command does on Windows or the ifconfig does on Linux. It shows all the interfaces we have running
netstat -rDisplay Current Routing Table
netstat -aDisplays all active TCP connections and the TCP and UDP ports on which the computer is listening, regardless of the state
netstat -atIt shows all the active TCP internet connections regardless of the state
netstat -nDisplays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
netstat -oDisplays active TCP connections and includes the process ID (PID) for each connection.
netstat -eDisplays Ethernet statistics, such as the number of bytes and packets sent and received.
netstat -auIt shows all the active UDP internet connections regardless of the state
netstat -ltList of all Listening TCP Ports
netstat -luList of all Listening UDP Ports
netstat -pIt shows connections and the process or program that is running
netstat -atpIt shows Active TCP connections along the processes or programs that are running
netstat -tnlIt shows list of TCP connections that are listening
netstat -unlIt shows list of UDP connections that are listening
netstat -nlp | grep :8501List of networks that are active for a particular port
netstat -tunlpTCP and UDP listening programs

Share