Tuesday, April 11, 2023

netstat Command line for looking at specific port

In cmd:

netstat -na | find "8080"

In bash:

netstat -na | grep "8080"

In PowerShell:

netstat -na | Select-String "8080"

 

C:\Users\User>netstat -aon | find "8001"

  TCP    [::1]:8001             [::]:0                 LISTENING       7940


C:\Users\User>taskkill /F /pid 7940

SUCCESS: The process with PID 7940 has been terminated.

No comments: