Josh Jackson (pturing) wrote in projectcreation,
Josh Jackson
pturing
projectcreation

  • Mood:

first submission

This is a shell script I just wrote.
comments welcome

#!/bin/sh
#
# regexkillall.sh
# kill all processes matching a regular expression
# Usage:   regexkillall.sh patterntokill [-signal] 
# Example: regexkillall.sh vmware -9

ps ax -o pid,comm | grep $1 | tr -cd 0-9[:space:]  | sed 's/^ *//' | cut -f 1 -d " " | xargs kill $2
  • Post a new comment

    Error

    default userpic
  • 0 comments