Search code examples
bashprocesskillnohup

How to kill a nohup process?


I executed the following command

$ nohup ./tests.run.pl 0 &

now when I try to kill it (and the executions that are started from this script) using

$ kill -0 <process_id>

it does not work. How can I kill a nohupped process and the processes that runs via the nohupped script?

Thanks


Solution

  • kill -0 does not kill the process. It just checks if you could send a signal to it.

    Simply kill pid, and if that doesn't work, try kill -9 pid.