Skip to content

Instantly share code, notes, and snippets.

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 morulus/281e02038aa304a95d9845843613ffc2 to your computer and use it in GitHub Desktop.
Save morulus/281e02038aa304a95d9845843613ffc2 to your computer and use it in GitHub Desktop.
# List all node processes
ps -ef | grep " node" | awk '{print $8, $2}'
# Kill all node processes
ps -ef | grep " node" | awk '{print $2}' | xargs -n 1 bash -c 'kill -9 "$1" 2>/dev/null || echo "Pid $1 is invalid"' --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment