Created
June 22, 2018 15:41
-
-
Save banjeremy/9b6bd076d4d6acde141a4a893d2ae2f4 to your computer and use it in GitHub Desktop.
reckless process murdering script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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