Screen recording and playback using Linux commands

Source: Internet
Author: User

Screen recording and playback using Linux commands

If you can record screens during work and study, you will be able to read the rare learning materials in the future. Some remote operations are command line operations. If screen recording software is used, it may occupy a lot of space. In Linux, you can use the command line to achieve screen recording and screen playback.

If you need to demonstrate some operations to others, you may have prepared them in advance. You only need to play the demo. Or you need to keep the necessary logs during system upgrade, and you can make a more targeted summary later, all of which can be done through the screen recording function.

Script and scriptreplay must be installed in the system.

For example, we can do this in the following way. Simply run several commands, and then check whether the output can be completed step by step through playback.

$ Script-t 2> time. log-a record. session
Script started, file is record. session
$ Echo test begin
Test begin
$ Echo test start
Test start
$ Echo test end
Test end
$ Exit
Exit
Script done, file is record. session

The recording on this screen is over. We use scriptreplay to play back this process.
$ Scriptreplay time. log record. session
After you enter this command, you will see the screen as if it was manipulated. You can run the command step by step and then output the command.
If you need to view this process on another machine, you can copy the files generated by time. log and record. session to directly run the command.
The content of the timestamp file is as follows. All records a little bit of operation time information.
$ Cat time. log
0.350314 17
0.052705 1
1.176860 1
0.241008 1
0.064975 1
....
The record. session file is a log file, which records the operations in each step.

Script started on Sun 04 Jan 2015 05:13:46 AM PST
$ Echo test begin
Test begin
$ Echo test start
Test start
$ Echo test end
Test end
$ Exit
Exit

Script done on Sun 04 Jan 2015 05:14:05 AM PST

The above functions can greatly improve our work efficiency. After all, logs are required for troubleshooting many problems and detailed operation information is required. This information is equivalent to a complete playback of the problem handling process.
If you are not satisfied with this, you can try to share the screen content to others in real time. Others can see all your operations without installing other video software.
After all, video recording requires a lot of resources.
After repeated attempts, it is found that this operation is normal for two people to share the output. If there are multiple sessions, some operations may be incomplete.
We start two sessions. Assume that session1 and session2 are both on the same server and in the same directory.
Session1 creates a fifo log.
> Mkfifo. log

Session2 starts listening preparation
> Cat fifo. log
Prepare output from session1
> Script-f fifo. log
Script started, file is fifo. log
$ Ls -- any of our operations will be captured in session2 at this time.

How to install the Screen recording tool Simple Screen Recorder 0.3.1 in Ubuntu

Use the avconv tool in Linux to record desktop videos and audios.

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

This article permanently updates the link address:

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.