分类: LINUX
2010-11-03 11:48:41
(1)查询当前登录用户
~]# finger 也可以w命令
# finger
Login Name Tty Idle Login Time Office Office Phone
root root pts/1 56 Nov 3 09:47 (xxxx)
root root pts/2 4 Nov 3 11:33 (xxxx)
root root pts/3 Nov 3 11:37 (xxxx)
(2)查询某个登录用户的所有进程
ps -ef | grep pts/2
root 32183 4010 0 11:33 ? 00:00:00 sshd: root@pts/2
root 32191 32183 0 11:33 pts/2 00:00:00 -bash
root 32229 32191 0 11:33 pts/2 00:00:00 tail -f /var/log/messages
root 32464 32374 0 11:39 pts/3 00:00:00 grep pts/2
(3)干掉登录用户Shell 进程
kill -9 32191