linux kill all processes with name code example
Example 1: kill all processes by name linux
ps -ef | grep 'myProcessName' | grep -v grep | awk '{print $2}' | xargs -r kill -9
Example 2: killall by name
pkill -f pattern
ps -ef | grep 'myProcessName' | grep -v grep | awk '{print $2}' | xargs -r kill -9
pkill -f pattern