两人同时登录一台linux主机或同时打开两个会话窗口,如下:
[root@puppet ~]# w
02:00:59 up 64 days, 7:15, 3 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.204.98 00:27 31:52 0.03s 0.00s vi 123/
root pts/1 192.168.204.50 00:50 0.00s 0.01s 0.00s w
root pts/2 192.168.204.50 01:59 52.00s 0.06s 0.06s -bash
在A终端输入如下:
echo "hello ,what are you doing ?" > /dev/pts/1
在B终端显示如下:
hello ,what are you doing ?
在B终端输入如下:
echo "hi I am working." > /dev/pts/2
在A终端显示如下:
[root@puppet ~]# echo "hello ,what are you doing ?" > /dev/pts/1
[root@puppet ~]# hi I am working.
本文出自 “青春邓勇” 博客,请务必保留此出处http://dengyong.blog.51cto.com/8409869/1433666
在linux终端下聊天(会话),布布扣,bubuko.com
原文地址:http://dengyong.blog.51cto.com/8409869/1433666