Читать книгу Linux Bible - Christopher Negus - Страница 189
Using killall to signal processes by name
ОглавлениеWith the killall
command, you can signal processes by name instead of by process ID. The advantage is that you don't have to look up the process ID of the process that you want to kill. The potential downside is that you can kill more processes than you mean to if you are not careful. (For example, typing killall bash
may kill a bunch of shells that you don't mean to kill.)
Like the kill
command, killall
uses SIGTERM
(signal 15) if you don't explicitly enter a signal number. Also as with kill
, you can send any signal you like to the process you name with killall
. For example, if you see a process called testme
running on your system and you want to kill it, you can simply enter the following:
$ killall -9 testme
The killall
command can be particularly useful if you want to kill a bunch of commands of the same name.