Use a regex pattern with killall where supported.

Section: Batch Termination Patterns

Kill using regex

bash
bash
killall -r "worker[0-9]+"
Explanation

Use a regex pattern with killall where supported.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Batch Termination Patterns
Kill all by user and name
Limit killall by user and executable name.
OpenIn sheetbashsame section
Kill exact process name
Only match an exact process name.
OpenIn sheetbashsame section
Kill by parent PID
Signal all child processes of a parent.
OpenIn sheetbashsame section
Terminate port owners with lsof and xargs
Combine lsof and xargs to terminate port users.
OpenIn sheetbashsame section
Start command in background
Launch a command as a background job.
Trap shell signals
Handle a signal in a shell script.