How can I remove the current process/application which is already assigned to a port?
For example: localhost:8080
localhost:8080
Here is a script to do it in WSL2
PIDS=$(cmd.exe /c netstat -ano | cmd.exe /c findstr :$1 | awk '{print $5}') for pid in $PIDS do cmd.exe /c taskkill /PID $pid /F done