The other week I learnt a valuable lesson about
pkill, namely that it will match like a greedy little bastard unless instructed not to, which may have unintended consequences…
To illustrate, consider these two images:
So what happens is I start two processes,
foobar (which are simple shell scripts running
pkill foo, and both
--exact) to the pkill command will ensure that only
foo gets killed.
If you want to go overnuking everything, regular
pkill will serve you well, but if you are looking for a scalpel, then
-x is most definitively what you want.