# Get a list of PIDs matching the pattern
pgrep example
# Kill all PIDs matching the pattern
pgrep example | xargs kill