Last active
September 16, 2021 10:33
-
-
Save niketpathak/52b4aafb82e27bcf43d83382d9d47307 to your computer and use it in GitHub Desktop.
Free up a specific Port
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
# Get the process ID of the process running on port xyz | |
lsof -i -P -n | grep xyz # xyz is the desired port number | |
# Force kill the process running on the port by providing the process ID you find from the above statement | |
kill -9 processID | |
# if you have npm/npx | |
npx kill-port portNumber | |
#### More info on lsof #### | |
# lsof => list open files | |
# -i => selects IPv[46] files | |
# -P => No port names | |
# -n => no host names | |
#### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment