正在停止Linux多末端操做时,若是可以真现差别末端之间的异步,这么便可以正在各个末端上显现雷同的操做效因,可以节俭不少工夫,操做要领也很简略,上面小编便给各人引见高Linux差别末端间异步的要领。
装置必需硬件
#yum install tcl expect
(1)确认以后地点末端号:
[root@localhost shell]# w
17:59:31 up 9:47, 5 users, load average: 0.06, 0.02, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty3 - 08:15 9:44m 0.75s 0.75s 。/xrgsu -a
root tty1 :0 17:08 9:47m 9.41s 9.41s /usr/bin/Xorg :
root pts/0 :0.0 17:25 0.00s 3.04s 0.00s w
root pts/1 :0.0 17:33 10:04 0.11s 0.11s bash
root pts/3 :0.0 17:39 46.00s 0.02s 0.02s /bin/bash
(2)以root用户身份背指定末端倡议异步号令:
=========pts/0 背pts/1 倡议操做========
[root@localhost shell]# kibitz -tty pts/1 root
asking root to type: kibitz -4010
=========pts/1 支到恳求 =============
[root@localhost shell]#
Message from root@localhost.localdomain on pts/0 at 18:02 。。.
Can we talk? Run: kibitz -4010
EOF
(3)按回车,输进 kibitz -4010
[root@localhost shell]# kibitz -4010
Escape sequence is ^]
此时,pts/0 取pts/1二个末端未异步,节制任何一个末端能够正在二边显现操做疑息。
(4)再次查看末端形态
[root@localhost shell]# w
18:06:10 up 9:54, 5 users, load average: 0.04, 0.02, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty3 - 08:15 9:50m 0.76s 0.76s 。/xrgsu -a
root tty1 :0 17:08 9:54m 12.66s 12.66s /usr/bin/Xorg :
root pts/0 :0.0 17:25 1:58 5.41s 0.00s expect -- /usr/
root pts/1 :0.0 17:33 0.00s 0.11s 0.00s expect -- /usr/
root pts/3 :0.0 17:39 4:17 0.03s 0.03s /bin/bash
pts/0战pts/1曾经经由过程expect步伐异步,pts/3出有异步。
相关文章