Skip to main content
Kill -9 Club
Sign in

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: pkill kills everything the pattern catches, and a short pattern catches more than you think. For a service systemd manages, systemctl stop is 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 with pgrep -f first: a pattern aimed at one process can hit ten.

Lessons that teach it