Skip to content

Instantly share code, notes, and snippets.

@jredrejo
Created May 16, 2019 16:31
Show Gist options
  • Save jredrejo/1221cde247a48a734010ebcec0f085bf to your computer and use it in GitHub Desktop.
Save jredrejo/1221cde247a48a734010ebcec0f085bf to your computer and use it in GitHub Desktop.
kill process running giving its name
#!/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