How to kill a process in MacOS?

后端 未结 9 1731
日久生厌
日久生厌 2021-01-30 04:05

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/         


        
9条回答
  •  伪装坚强ぢ
    2021-01-30 04:25

    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.

提交回复
热议问题