pkill
ProcessesPackage: procpsHandle with care
Sends a signal to every process whose name matches the pattern. The pattern is a regular expression matching part of the name: pkill node reaches node_exporter too.
A mistake with this command can destroy data or lock you out
- Always run
pgrep -a <pattern>first:pkillkills everything the pattern catches, and a short pattern catches more than you think. For a service systemd manages,systemctl stopis the right command.
What its options do in the lessons
From the same glossary the lessons render under their commands, so the two cannot disagree.
pkill -f- The same matching as
pgrep -f, but to send a signal. Check withpgrep -ffirst: a pattern aimed at one process can hit ten.
