Created
May 16, 2019 16:31
-
-
Save jredrejo/1221cde247a48a734010ebcec0f085bf to your computer and use it in GitHub Desktop.
kill process running giving its name
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/sh | |
# usage: pskill.sh kk.py | |
# to kill process kk.py | |
PID="$(ps aux|grep $1|grep -v grep|grep -v pskill|awk '{print $2}')" | |
[ -z "$PID" ] && exit 1 | |
kill $PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment