In Linux, use command lines to implement video and broadcast teaching functions. In Linux, use command lines to implement Recording and playback of terminal sessions and broadcast teaching functions. www.2cto.com script and scriptreplay are available in the vast majority of GNU/Linux releases. scripts are used to record screen sessions to a file, and scriptreplay is used to record screen sessions for playback, let's take a look at how it is implemented:
We can start recording screen sessions like this: $ script-t 2> timing. log-a output. session $ type commands; # in this case, as we usually do, nothing should be input. ... Exit # May input more than N commands. If you think you only need to record it here, enter exit to end it. Note: There are two configuration files (timing. log, output. session) is passed to the script command as a parameter, where timing. log files are used to store the running time information of each command, output. session files are used to store command output (in fact, screen output ). -T is used to dump time data to stderr, so we use 2> to redirect stderr to timing. log, timing. log and output. session can be customized. In the same path, we can use these two files to play back the screen session: $ scriptreplay timing. log output. session ........ # Here is the content to be output. It's easy. In addition, we only need to share these two files with others. Others can watch this "video". Of course, there is no sound, but there is a considerable benefit, the file will be quite small, suitable for transmission on the Internet. Www.2cto.com next let's see how to implement real-time broadcast under the command line. This method is especially suitable for teaching and absolutely smooth. First, start two terminals, terminal1 and terminal2. 1. Enter the following command on terminal1: $ mkfifo scriptfifo # the file name can be customized. 2. Enter the following command on terminal2. $ cat scriptfifo # Of course, you need to find the correct path.
3. Return to terminal1 and enter the following command: $ script-f scriptfifo $ type commands; $ ...... $ ...... # multiple commands may be entered. If you do not need to broadcast, enter exit and press Enter. In this way, if your student opens terminal, he/she can see in real time how you (teacher) operate.