List listening ports and applicationli

netstat -ano | egrep 'Proto|LISTEN'

  • -a Show the state of all sockets, including passive sockets used by server processes
  • -n Show network addresses as numbers
  • -o Show process Id

netstat -ano | grep 8080

Show which application is using that port:

netstat -anb | grep -A 1 "8080"

  • -b Display executable listening on port
  • grep
  • -A option is to display the preceding line after greps returned result