ps -ef | grep get only PID's and kill them code example Example: how to kill tasks using grep kill -9 $(ps aux | grep KeyWordHere | awk '{print $2}')