-
-
Save Fang-Li/6d7828b4160e8ef5bcc2c9f6bda55c0a to your computer and use it in GitHub Desktop.
Kill process by match the whole command line (like ps -ef) Usage: ekill <pattern> [signal]
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
#!/bin/bash | |
SIG="-2" | |
if [[ "$2" != "" ]]; then | |
SIG="$2" | |
fi | |
ps -ef | grep $1 | grep -v grep | awk '{print $2}' | xargs kill $SIG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment