command overview

  • netstat -a
    • Displays all of the current connections and listening ports on the system
  • netstat -t
    • list tcp connections
  • netstat -u
    • list udp connections
  • netstat -at
    • list all TCP ports
  • netstat -au
    • list all udp ports
  • netstat -r
    • Display routing table
  • netstat -l
    • Display listening ports
  • netstat -lx
    • list linux listenig ports
  • netstat -lp
    • display all the listening ports (both TCP and UDP) along with the process IDs and the names of the programs
  • netstat -s
    • Statistics by Protocol
  • *netstat -an grep ‘:[port number]’*
    • find portnumber
  • netstat -nao
    • will tell you what ports your system has listening, as well as what you are connected to via TCP
  • netstat -naob
    • This gives you the process name rather than the process ID (run as Administrator)

source