Skip to content

Instantly share code, notes, and snippets.

@tomykaira
Last active August 29, 2015 14:14
Show Gist options
  • Save tomykaira/5cde0ce56f0346e0a67b to your computer and use it in GitHub Desktop.
Save tomykaira/5cde0ce56f0346e0a67b to your computer and use it in GitHub Desktop.
function pp () {
export PREVIOUS_PP_ARGS="$*"
pgrep -lfa $*
}
function pk () {
if [ $# -eq 0 ]; then
pgrep -lf $PREVIOUS_PP_ARGS | awk '{print $1}' | xargs kill
else
pgrep -lf $PREVIOUS_PP_ARGS | sed "$1q;d" | awk '{print $1}' | xargs kill
fi
}
function pkk () {
if [ $# -eq 0 ]; then
pgrep -lf $PREVIOUS_PP_ARGS | awk '{print $1}' | xargs kill -9
else
pgrep -lf $PREVIOUS_PP_ARGS | sed "$1q;d" | awk '{print $1}' | xargs kill -9
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment