*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">

</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>