*2 Feb 2015* <div class="posthaven-post-body"> Sometimes you want to kill a process but you either don’t know the exact name of the executable file, or you know part of the command arguments. killall is not your friend in those situations. Here’s a quick script to grep on part of a process name or arguments and kill it. <div> \ </div> <div> <div id="posthaven_gallery[788384]" class="posthaven-gallery"> ![](https://phaven-prod.s3.amazonaws.com/files/image_part/asset/1335241/XGfPYLipbGe0NYbKj_mnuSUKiP4/destroy.gif) </div> </div> <div> \ </div> <div> Full script (put it in a path included folder and change it’s permissions to executable +x): </div> <div> \ </div> > <div> > > <div> > > \#!/bin/bash > > </div> > > </div> > > <div> > > <div> > > ps aux \| grep \$1 \| grep -v grep \| awk '{print \$2}' \| xargs kill -9 > > </div> > > </div> </div>