Skip to content

Instantly share code, notes, and snippets.

@tubaman
Last active June 24, 2020 19:53
Show Gist options
  • Save tubaman/c0eda7b85343b805f575b8fa3be024be to your computer and use it in GitHub Desktop.
Save tubaman/c0eda7b85343b805f575b8fa3be024be to your computer and use it in GitHub Desktop.
Linux CLI to kill a process using pgrep arguments as nicely but surely as possible
#!/bin/bash
# uses surekillpid: https://gist.github.com/tubaman/377458a11fedb49cc2132ea6e31ae8b2
pgrep $@ | grep -v $$ | xargs --no-run-if-empty surekillpid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment