// You can change the to kill other processes search_terms='java' kill $(ps aux | grep "$search_terms" | grep -v 'grep' | awk '{print $2}')