Linux Terminal recording screen and play script command

Source: Internet
Author: User
Tags clear screen

scriptis a very cool command, it can be all the operation of the terminal and input and output recorded, and through scriptreplay playback, is the command line version "屏幕录像专家" . Very useful, for example, you want to teach a lot of people to configure a software, you can configure the process to record, and then send others self-taught, gray elegant!

One. Installation

Most operating systems are installed by default Redhat/Fedora/CentOS :

Host: Bj_web_ip:252.97 User: Root Dir:~$ >>Yum Install Util-linux-ng
Or
Host: Bj_web_ip:252.97 User: Root Dir:~$ >>rpm-vih/mnt/Packages/util-linux-ng-2.17.2-12.24. el6.x86_64.rpm
Second, recording and playback

host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >>  script-t-a 2  > /tmp/time . Txt/tmp/record.txt 

ctrl+d   or  exit   End recording

simply say the parameters of the command:
-tis to output the time data to standard error, so to use 2>/tmp/time.txt to redirect the data to the file, in some cases do not need to replay, as long as the record operation and input and output, you can not specify this parameter
-aAppend content to file, not overwrite previous record
-qQuiet mode, does not prompt the user script to run
-fClear screen after each write, useful when used with piping
-cThese non-interactive run commands or scripts are useful when some programs or scripts are running in the background

2.2 Plays
host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >>  scriptreplay/tmp/time.txt/tmp/record.txt 

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/86/29/wKiom1e2iR-Q3rj1AAO1yLlxw3E650.gif "title=" Gif.gif "alt=" Wkiom1e2ir-q3rj1aao1yllxw3e650.gif "/>

2.3 Logging User Actions

Record a user and include in the user's ~/.profile file:

host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >> /usr/bin/script-qa/tmp/user_record 

Log all user actions and add the above content to the/etc/profile file. Record user operation output will be more, playback is very time-consuming, so usually do not record time

2.4 Live broadcast operations

1, broadcast their own operations to other users on the server to see, you need to create a pipeline first:

host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >>  mkfifo/tmp/fifo 

2, SCRITP output to pipeline:

host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >>  script-f/tmp/fifo 

3, other users execute:

host  :bj_web_ip  :  252.97  user  :root  dir  :~  $  >>  cat/tmp/fifo 

4, you can view the operation and input and output in real time (other users can only view or exit exit, unable to operate the command)

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/29/wKioL1e2itfwUpISAAHz6p_nbKs971.gif "title=" Gif2.gif "alt=" Wkiol1e2itfwupisaahz6p_nbks971.gif "/>

This article from "Live by the Sea like Waves" blog, please be sure to keep this source http://zhang789.blog.51cto.com/11045979/1840257

Linux Terminal recording screen and play script command

Related Article

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.