Last active
August 29, 2015 14:12
-
-
Save r3bo0t/09c6d0591fba94cadef4 to your computer and use it in GitHub Desktop.
Kill all shell 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 -x | |
# Kill all the existing process with given name and for current user | |
user=whoami | |
for processid in `pgrep -U $user $1`; do | |
kill -9 $processid; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment