how to kill 2 processes in linux
I have two programs running simultaneously ( in linux ) , with one running at the background. When i press ctrl+c , the prompt returns , but the processes seem to cont开发者_JAVA技巧inue.. How to kill them both ?
use pkill myprocess
. If not, check the pid of the background process using ps -ef
, then use kill -9 <pid>
. you can also use pgrep myprocess
to find those pids.
Background processes started from the same as your current shell are visible through job control as well. In bash type "jobs" and you can kill %1 for example.
精彩评论