Use command lines in Linux to implement video and broadcast teaching functions

Source: Internet
Author: User


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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.