#!/bin/bash
#FileName killuser.sh
#The script to kill logined user.
#Using #/bin/bash killuser.sh root
username="$1"
/bin/ps aux | /bin/grep $username | /bin/awk '{ print $2 }' > /tmp/temp.pid
killid=`/bin/cat /tmp/temp.pid`
for PID in $killid
do
/bin/kill -9 $PID 2 > /dev/null
done
2016-11-16
删除指定的登陆用户
评论
发表评论
姓 名: