kill all ports code example
Example 1: windows kill port
netstat -ano | findstr :3001
taskkill /PID <yourid> /F
Example 2: kill local host bash
npx kill-port 8080
Example 3: stop port
kill -9 $(sudo lsof -t -i:'portName')
//Ex. if portname is 3000
//then we will execute "kill -9 $(sudo lsof -t -i:3000)"
Example 4: kill all process at port
lsof -ti tcp:2525 | xargs kill
Example 5: kill port
kill -9 $(lsof -t -i:8080)
Example 6: stop localhost server
netstat -ano | findstr :yourPortNumber
tskill typeyourPIDhere