linux kill all process by 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: how to kill process by command name
pkill firefox
Example 3: kill process by name
#on a cluster #sbatch process
scancel -u username