Despite its name (that it’s gotten from its most popular usecase),
kill is very versatile tool used to send specified signals to individual
processes, or process groups.
It is part of the
util-linux collection of programs and is widely available.
Here area a couple of usage examples. If no signal name/number is specified,
SIGTERM (15) is assumed:
SIGTERM (15) signal to every process invoked as
kill 15222 152101 -8:
Send signal number
8 to PIDs
kill 152101 firefox -SIGKILL
SIGKILL (9) signal to PID 152101 and every process invoked as
kill -s 19 1022 kitty
Send signal number
19 to PID 1022 and every process invoked as
kill -SIGKILL -933
SIGKILL (9) signal to all processes in the process group
kill -p firefox
Don’t send any signals, but print PIDs of named processes listed, and exit.
pidof is a tool used to list PIDs of processes by name. It doesn’t conduct any manipulation. It’s very useful when dealing with other
, more primitive tools that conduct process manipulation but don’t have the ability to find PIDs based on their names.
Here are some usage examples:
List PIDs of all processes with the name
'firefox'. PIDs are by default separated by space.
pidof firefox kitty -S x
List PIDs of all processes with the names
'kitty', and separate PIDs with the character
kill on steroids. In addition to support the same operations as
kill, it sports a bunch of other features, such as case
insensitive search, matching process names using regexes, killing all processes belonging to a group of a specified process, filtering processes
based on spawn-time and owning user…
Here are some usage examples that demonstrate functionality not available in
killall firefox -Ii --user bogdan --younger-than 4.2m
Case-insensitively match every process’ name agaisnt
firefox that belongs to the user
bogdan, was spawned less than 4.2 minutes ago,
and send a
SIGTERM (15) to it. Interactively ask the user to confirm each match.
killall -I -9 -r 'kitty[1-9]+\.19'
Case-insenstively match every process against the specified regex, and send it a
SIGKILL (9) signal, prompting the user before every
These two are pretty similar
killall, though they have even more functionality.
pgrep matches process names against regexes and prints them out, while
pkill does the
same in addition to sending signals.
They sport options such as
-c (suppresses normal output and prints a count of process matches to stdout, eliminating the need for hacky shell piping such -
this can be interpreted as a good or a bad thing). Another example is the ability to test for multiple owning users (e.g.
-u bogdan,root) will match processes owned by
These two are the ones that I use most often, probably after
In addition to the tools described here, other, more sophisticated alternatives have their ways of manipulating processes as well. Tools such as
htop for example allow you to browse and manipulate processes in real time.