Created
June 17, 2014 10:07
-
-
Save ronisaha/6064f61890febf87a3d3 to your computer and use it in GitHub Desktop.
bash script - kills all pids matching the search term of "PROCESS".
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 | |
| if [ 0 == $# ]; then | |
| echo -n "Provide Process String:" | |
| read PROCESS | |
| else | |
| PROCESS="$1" | |
| fi | |
| if [[ -z $PROCESS ]]; then | |
| echo "No process string given" | |
| else | |
| ps aux | grep ${PROCESS} | grep -v grep | awk {'print$2'} | xargs kill -9 | |
| ps aux | grep ${PROCESS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment