Last active
April 11, 2016 09:27
-
-
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
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
| # 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 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One can add this piece of code to .bashrc or .profile file