命令
write
描述
send a message to another user
发送消息给其他登录用户
用法
选项
无
注意
注意输出内容会打断当前的命令行
wall
命令是发送到所有终端,write
命令是发送到指定用户终端
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| $ w 21:45:07 up 1:25, 3 users, load average: 0.00, 0.01, 0.04 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 20:19 6:03 0.05s 0.05s -bash root pts/0 192.168.80.1 21:28 3.00s 0.08s 0.00s w root pts/1 192.168.80.1 20:22 19.00s 0.66s 0.66s -bash $ who root tty1 2021-03-20 20:19 root pts/0 2021-03-20 21:28 (192.168.80.1) root pts/1 2021-03-20 20:22 (192.168.80.1)
$ tty /dev/pts/0 $ write root /dev/pts/1 hi $ Message from root@node1 on pts/1 at 21:43 ... hello EOF
$ tty /dev/pts/1 $ Message from root@node1 on pts/0 at 21:42 ... hi EOF
$ write root pts/0 hello
|