Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

kill port

// Option 1: if you have npm@5.2.0^ version
npx kill-port 8080

// Linux
kill -9 $(lsof -t -i tcp:8080)

// Windows command line:
for /f "tokens=5" %a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %a

// Windows bat-file:
for /f "tokens=5" %%a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %%a
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #kill #port
ADD COMMENT
Topic
Name
2+2 =