I tried kill -9 698
but the process did not die.
$ ps -ef | grep chromium 502 698 811 0 0:01.24 ?? 0:07.28 /Users/lucius/chromium/src/xcodebuild/Debug/Chromium.app/Contents/MacOS/Chromium 502 854 732 0 0:00.00 ttys001 0:00.00 grep chromium $ kill -9 698 $ ps -ef | grep chromium 502 698 811 0 0:01.24 ?? 0:07.28 /Users/lucius/chromium/src/xcodebuild/Debug/Chromium.app/Contents/MacOS/Chromium 502 854 732 0 0:00.00 ttys001 0:00.00 grep chromium
Press Command-Option-Esc to display the Force Quit menu, choose the application, and press Force Quit. If the Finder is not working, click on the Apple menu, choose Force Quit, select the application, and press Force Quit. Launch Terminal and follow the steps for killing a process above.
If you're trying to kill -9 it, you have the correct PID, and nothing happens, then you don't have permissions to kill the process.
Solution:
$ sudo kill -9 PID
Okay, sure enough Mac OS/X does give an error message for this case:
$ kill -9 196 -bash: kill: (196) - Operation not permitted
So, if you're not getting an error message, you somehow aren't getting the right PID.
Some cases you might want to kill all the process running in a specific port. For example, if I am running a node app on 3000 port and I want to kill that and start a new one; then I found this command useful.
Find the process IDs running on TCP port 3000 and kill it
kill -9 `lsof -i TCP:3000 | awk '/LISTEN/{print $2}'`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With