Kill a user and his processes

#!/bin/sh
#
# Author: Tim Van Wassenhove
# Update: 12-12-2003 13:15
#
# This script kills all processes that are owned by a given user.
#

if [ -n "1" ]
then
        ps -ef | grep $1 | grep -v grep | awk ‘{ print }’ | xargs kill -9
else
        echo "Usage: killuser.sh username"
fi

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>