Created
December 20, 2018 08:54
-
-
Save lhstraathof/c4e53396f6fc42cc7a3b72c767ded1df to your computer and use it in GitHub Desktop.
Find and kill all process on a specific port on mac
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
# Run the following code in the terminal | |
# Find all processes running on a specific port (you can replace 3000 with any port): | |
[sudo] lsof -i :3000 | |
# Get the PID id of the process you want to kill. | |
# Then with the PID id run the following command to kill it: | |
kill -9 <PID> | |
# To kill all processes on a specific port, run the following command: | |
lsof -ti:3000 | xargs kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment