Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

12 Dec 2003

Kill a user and his processes

#!/bin/sh 
# 
# # Up#
# 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