查看当前系统的用户,who,w
$ w
15:05:42 up 4:49, 3 users, load average: 0.02, 0.01, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
server tty7 :0 14:06 4:43m 1:42 0.08s pam: gdm-passwo
server pts/0 :0.0 14:18 0.00s 0.23s 1.65s gnome-terminal
server pts/1 :0.0 14:47 4:43 0.01s 0.01s bash
$ who
bluebird tty1 2013-08-13 14:45 (:0)
bluebird pts/0 2013-08-13 14:45 (:0.0)
通知特定用户
通过设备文件通知,设备文件可以通过who命令看到
echo "I will close your connection" > /dev/pts/2
关闭用户连接
# fuser -k /dev/pts/2