Skip to content

Instantly share code, notes, and snippets.

@r3bo0t
Last active August 29, 2015 14:12
Show Gist options
  • Save r3bo0t/09c6d0591fba94cadef4 to your computer and use it in GitHub Desktop.
Save r3bo0t/09c6d0591fba94cadef4 to your computer and use it in GitHub Desktop.
Kill all shell process
#!/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