Last active
March 15, 2016 21:49
-
-
Save Khalian/a42d2d12802fa3cc0535 to your computer and use it in GitHub Desktop.
Kill processes with a certain name or prefix of name (Note this script is incredibly powerful, handle with care)
This file contains hidden or 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
#!/bin/sh | |
echo "Removing all processes associated with name $1" | |
if [ $# -ne 1 ] | |
then | |
echo "Usage : ./killp process name" | |
exit 0 | |
fi | |
pgrep $1 | xargs kill -9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment