Horje Website
stop port Code Example | Shell/Bash
windows kill port
  1. netstat -ano | findstr :3001
  2. taskkill /PID <yourid> /F
stop port
  1. kill -9 $(sudo lsof -t -i:'portName')
  2. //Ex. if portname is 3000
  3. //then we will execute "kill -9 $(sudo lsof -t -i:3000)"
netstat -ano | findstr kill
  1. Kill Process in Windows
  2. Step 1:
  3. Open up cmd.exe (note: you may need to run it as an administrator, but this isn't always necessary), then run the below command:
  4. netstat -ano | findstr :PORT_NUMBER
  5. (Replace PORT_NUMBER with the port number you want, but keep the colon)
  6. The area circled in red shows the PID (process identifier). Locate the PID of the process that's using the port you want.
  7. Step 2:
  8. Next, run the following command:
  9. taskkill /PID PORT_NUMBER /F
close all localhost connections
  1. netstat -ano | findstr :yourPortNumber
  2. taskkill /PID typeyourPIDhere /F
kill process on port in windows
  1. netstat -ano | findstr :PORT_NUMBER
  2. taskkill /PID PORT_NUMBER /F
February 22, 2021
Live Code, Shell/Bash Code

This article was posted in Live Code, Shell/Bash Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *


Horje © 2011 - 2023