Skip to main content
added 191 characters in body
Source Link
misteryes
  • 1.4k
  • 5
  • 19
  • 24

I want to kill the following processes using

pkill "run_tcp_sender.sh" 

or

pkill -SIGKILL "run_tcp_sender.sh"  root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14323 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14325 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14327 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14328 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14330 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 

but it is useless the processes remain there what is wrong with my command?

BTW: thanksI can use the following command to achieve what I want

kill -9 $(ps -ef|grep "run_tcp"|grep -v "grep"|awk '{print $2}') 

I want to kill the following processes using

pkill "run_tcp_sender.sh" root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14323 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14325 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14327 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14328 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14330 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 

but it is useless the processes remain there what is wrong with my command? thanks

I want to kill the following processes using

pkill "run_tcp_sender.sh" 

or

pkill -SIGKILL "run_tcp_sender.sh"  root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14323 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14325 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14327 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14328 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14330 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 

but it is useless the processes remain there what is wrong with my command?

BTW: I can use the following command to achieve what I want

kill -9 $(ps -ef|grep "run_tcp"|grep -v "grep"|awk '{print $2}') 
Source Link
misteryes
  • 1.4k
  • 5
  • 19
  • 24

pkill can't kill processes with parent process id 1

I want to kill the following processes using

pkill "run_tcp_sender.sh" root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14323 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14325 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14327 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14328 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 root 14330 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh 138.96.116.22 

but it is useless the processes remain there what is wrong with my command? thanks