Kill all processes with a given name

suppose we wish to kill all instances of rsync that is running
Simplest given that we know the process name

pkill rsync
ps aux|awk '/sleep/ {print "kill -9 " $1}'

Or a sligtly longer version that might(?) be more verbose as to what it does

kill -9 $(ps aux | grep '[r]sync' | awk '{print $2}')