Skip to content

Instantly share code, notes, and snippets.

@Kirens
Created January 31, 2017 15:19
Show Gist options
  • Select an option

  • Save Kirens/bbf3173923bede2b87bd6c2e4f63d173 to your computer and use it in GitHub Desktop.

Select an option

Save Kirens/bbf3173923bede2b87bd6c2e4f63d173 to your computer and use it in GitHub Desktop.
This line kills all bash scripts matching a string
ps -eo pid,cmd | grep "[S]CRIPT_NAME" | grep -oP "^[^0-9]*\K[0-9]*" | xargs kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment