SyntaxFix
Write A Post
Hire A Developer
Questions
pids=$(pgrep <name>)
will get you the pids of all processes with the given name. To kill them all, use
kill -9 $pids
To refrain from using a variable and directly kill all processes with a given name issue
pkill -9 <name>