How to achieve synchronization between different terminals in Linux system

  
                

When performing Linux multi-terminal operation, if synchronization between different terminals can be realized, the same operation effect can be displayed on each terminal, which can save a lot of time and the operation method is also very simple. Everyone introduces the method of synchronizing between different terminals of Linux.

must install software

#yum install tcl expect

(1) check the current location of terminal number:

[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.00sw

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) Initiate a synchronization command to the specified terminal as the root user:

=========pts/0 Initiating an operation to pts/1 ====== ==

[root@localhost shell]# kibitz -tty pts/1 root

ask root to type: kibitz -4010

======== =pts/1 Received request =============

[root@localhost shell]#

Message from [email protected] on pts/0 At 18:02. . .

Can we talk? Run: kibitz -4010

EOF

(3) Press Enter, type kibitz -4010

[root@localhost shell]# kibitz -4010

Escape sequence is ^]

At this point, pts/0 and pts/1 are synchronized, and any terminal can be controlled to display operation information on both sides.

(4) View terminal status again

[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.41 s 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 and pts/1 have been synchronized by the expect program, and pts/3 is not synchronized.
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved