Skip to content

Instantly share code, notes, and snippets.

@heroqu
Last active April 11, 2016 09:27
Show Gist options
  • Save heroqu/fd1205974bfd0afb0ad67023de628ba3 to your computer and use it in GitHub Desktop.
Save heroqu/fd1205974bfd0afb0ad67023de628ba3 to your computer and use it in GitHub Desktop.
Bash function (for OSX) to kill all running node processes, except for Atom editor
# kill all running node processes, except for Atom editor
function kinod {
read -r -p "Delete all node processes, except for Atom? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
kill -9 `ps aux | grep node | grep -v grep | grep -v 'Atom.app' | awk '{print $2}'`
;;
*)
echo -- cancel --
;;
esac
}
@heroqu
Copy link
Author

heroqu commented Apr 11, 2016

One can add this piece of code to .bashrc or .profile file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment