Saturday, November 12, 2022

How do we kill the processes in linux/unix with a process name?

Below is the command to kill all the processes running based on a process name: ps -ef | grep {process_name} | grep -v grep | awk '{print $2}' | xargs kill


Eg: Kill all the processes that have chrome as part of the process name: ps -ef | grep chrome | grep -v grep | awk '{print $2}' | xargs kill