Skip to content

Instantly share code, notes, and snippets.

@dylansalim3
Last active April 9, 2021 00:29
Show Gist options
  • Save dylansalim3/67af5ad8f8b1e948f297cca307f75d94 to your computer and use it in GitHub Desktop.
Save dylansalim3/67af5ad8f8b1e948f297cca307f75d94 to your computer and use it in GitHub Desktop.
// in cmd
netstat -aon | find "PORT_NUM"
// In bash:
netstat -na | grep "8080"
// In PowerShell:
netstat -na | Select-String "8080"
Sample Output:
TCP 0.0.0.0:4848 0.0.0.0:0 LISTENING 9856
TCP [::]:4848 [::]:0 LISTENING 9856
taskkill /F /PID 9856
Anyway you can stop the process which uses your port and let your application take it.
Use netstat -a -o -n to check for the port usages.
Use taskkill /F /PID <pid> to kill that process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment