Skip to content

Instantly share code, notes, and snippets.

@Khalian
Last active March 15, 2016 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Khalian/a42d2d12802fa3cc0535 to your computer and use it in GitHub Desktop.
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)
#!/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