Do you want to end one or more processes at a time using a regular expression (regex) on your Linux, FreeBSD, macOS or Unix-like system? Try:

pkill regex
pkill pattern
pkill -9 pattern

The regex or pattern will match the process names or command lines that you see using ps or top/htop etc. Pretty useful for CLI users.

@nixCraft

It would help if pkill had a --dry-run flag, to let you see exactly which processes would be killed otherwise. Because regex can be tricky.

@purrperl you can use pgrep to see what will match.

pgrep regex

Happy? Then proceed:
pkill regex

But, yeah dry run might be a better option.