windows kill process on port script code example
Example 1: cmd kill process on port
## check and kill used "ports"
netstat -ano | findstr :8080
taskkill /PID <yourid> /F
Example 2: kill process on port
#list process running on specified port (here 80, change to your port)
sudo lsof -i:80
#kill process on specified port (here 80, change to your port)
sudo kill $(sudo lsof -t -i:80)