Find and kill a process using bash and regex

#!/bin/bash
kill $(ps aux | grep '[ search-for ]' | awk '{print $2}')

 

Top