#!/bin/bash pids=$(ps -ef | grep XXX| awk '{print $2}') for pid in $pids do echo $pid kill -9 $pid done
---------------------------------------------------------