The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
 

killall - Terminate Multiple Processes




Compared to killing processes one by one using kill, killall' allows you to terminate a group of processes based on their names. This can be convenient for quickly terminating multiple processes, but it also carries the risk of accidentally terminating unintended processes. Use with caution.

Example:
$ seq 1000000000 > /dev/null & ←Let the PC calculate up to a billion in the background
[1] 5819
$ seq 2000000000 > /dev/null & ←Let the PC calculate up to two billion in the background
[2] 5826
$ jobs ←Check if the calculations are running
[1]- Running seq 1000000000 > /dev/null &
[2]+ Running seq 2000000000 > /dev/null &
$ killall seq ←Terminate all 'seq' processes
$ jobs  ←Check to see if they've been terminated
[1]- Terminated seq 1000000000 > /dev/null
[2]+ Terminated seq 2000000000 > /dev/null

For more examples, explanations, and options, you can refer to this link.