Skip to content

Instantly share code, notes, and snippets.

@banjeremy
Created June 22, 2018 15:41
Show Gist options
  • Save banjeremy/9b6bd076d4d6acde141a4a893d2ae2f4 to your computer and use it in GitHub Desktop.
Save banjeremy/9b6bd076d4d6acde141a4a893d2ae2f4 to your computer and use it in GitHub Desktop.
reckless process murdering script
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
echo "usage: fu <grep pattern>"
exit 1
fi
pattern=$1
for p in `ps|grep $pattern|cut -f1 -d' '`; do
if [ "$p" -ne "$$" ] # let's try not to kill ourselves in our recklessness
then
echo "kill -9 $p > /dev/null 2>&1"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment