![如何向特定用户发送消息?](https://linux22.com/image/553194/%E5%A6%82%E4%BD%95%E5%90%91%E7%89%B9%E5%AE%9A%E7%94%A8%E6%88%B7%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%EF%BC%9F.png)
这是输出的一个条目who
:
yang pts/6 2011-06-22 09:25 (10.231.22.12)
有没有办法向那里发送消息?
答案1
尝试这个:
write yang /dev/pts/6
#type your message
#ctrl + D (EOF)
看:man 1 write
或者echo "message" > /dev/pts/6
答案2
~# tty
/dev/pts/89
~# echo hello to myself >/dev/pts/89
hello to myself
或者
~# echo hello to myself >`tty`
hello to myself
或者写几行:
~# cat >>`tty`
hello
from another
way
of doing this
^D
其中 ^D = CTRL+D。