Last active
April 27, 2022 10:57
-
-
Save Okwori/85021a63ec44ae1781022b394f68e0d2 to your computer and use it in GitHub Desktop.
Kill a process from the cmd on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Start cmd as admin | |
netstat -ano | findstr :3000 # r specify other port number | |
## Then get the processID from the previous command | |
taskkill /PID typeyourPIDhere /F # replace 'typeyourPIDhere' with appropraite process ID | |
## UBUNTU ## | |
You want to use backtick not regular tick: | |
sudo kill -9 `sudo lsof -t -i:9001` | |
If that doesn't work you could also use $() for command interpolation: | |
sudo kill -9 $(sudo lsof -t -i:9001) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment