在Linux上录制终端的操作

来源 http://blog.51cto.com/stuart/1831570

一、安装基础软件包

1
[root@test software]# yum install libMagickCore libMagickWand libjpeg-turbo-devel libjpeg-turbo libpng-devel compat-glibc-headers libbsd-devel xdotool -y

二、安装ttyrec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[root@test software]# tar xf ttyrec-1.0.8.tar.gz
[root@test software]# unzip -q ttyrec-1.0.8.RHEL5.patch.zip
[root@test software]# cd ttyrec-1.0.8
[root@test ttyrec-1.0.8]# patch -i ttyrec-1.0.8.RHEL5.patch          //打补丁
patching file Makefile
patching file ttyrec.c
[root@test ttyrec-1.0.8]# make
gcc -O2 -DHAVE_openpty   -c -o ttyrec.o ttyrec.c
gcc -O2 -DHAVE_openpty   -c -o io.o io.c
gcc -O2 -DHAVE_openpty -o ttyrec ttyrec.o io.o -lutil
gcc -O2 -DHAVE_openpty   -c -o ttyplay.o ttyplay.c
gcc -O2 -DHAVE_openpty -o ttyplay ttyplay.o io.o
gcc -O2 -DHAVE_openpty   -c -o ttytime.o ttytime.c
gcc -O2 -DHAVE_openpty -o ttytime ttytime.o io.o
[root@test ttyrec-1.0.8]# ll
total 188
-rw-r--r-- 1 root root  4193 Jun 11  2006 io.c
-rw-r--r-- 1 root root   371 Jun 11  2006 io.h
-rw-r--r-- 1 root root  4256 Jul 23 04:32 io.o
-rw-r--r-- 1 root root   654 Jul 23 04:32 Makefile
-rw-r--r-- 1 root root   429 Jun 11  2006 README
-rw-r--r-- 1 root root  1588 Mar 13  2015 tty2gif.py
-rwxr-xr-x 1 root root 20327 Jul 23 09:57 ttygif
-rwxr-xr-x 1 root root 15447 Jul 23 04:32 ttyplay
-rw-r--r-- 1 root root  1128 Jun 11  2006 ttyplay.1
-rw-r--r-- 1 root root  7687 Jun 11  2006 ttyplay.c
-rw-r--r-- 1 root root  8648 Jul 23 04:32 ttyplay.o
-rwxr-xr-x 1 root root 24505 Jul 23 04:32 ttyrec
-rw-r--r-- 1 root root  1454 Jun 11  2006 ttyrec.1
-rw-r--r-- 1 root root   935 Jul 23 04:31 ttyrec-1.0.8.RHEL5.patch
-rw-r--r-- 1 root root  9789 Jul 23 04:32 ttyrec.c
-rw-r--r-- 1 root root   145 Jun 11  2006 ttyrec.h
-rw-r--r-- 1 root root 18168 Jul 23 04:32 ttyrec.o
-rw-r--r-- 1 root root   441 Jul 23 09:21 ttyrecord
-rwxr-xr-x 1 root root  9995 Jul 23 04:32 ttytime
-rw-r--r-- 1 root root   432 Jun 11  2006 ttytime.1
-rw-r--r-- 1 root root  2459 Jun 11  2006 ttytime.c
-rw-r--r-- 1 root root  2152 Jul 23 04:32 ttytime.o
[root@jrgc ttyrec-1.0.8]# cp ttyplay ttyrec ttytime /usr/local/bin
[root@jrgc ttyrec-1.0.8]# ttyrec                         //进行录制
[root@jrgc ttyrec-1.0.8]# echo "hello,word"
hello,word
[root@jrgc ttyrec-1.0.8]# exit                          //结束录制
[root@test ttyrec-1.0.8]# ttyplay ttyrecord             //本地播放,ttyrecord录制后默认文件,可以自定义文件
[root@test ttyrec-1.0.8]# ttyrec test                  //自定义录制文件
[root@test ttyrec-1.0.8]# ll test
-rw-r--r--. 1 root root 466 Jul 23 19:28 test

三、将录制文件转换成GIF

1
2
3
4
5
6
7
8
9
10
11
[root@test software]# unzip -q seq2gif-master.zip
[root@test seq2gif-master]# ./configure
[root@test seq2gif-master]# make
[root@test seq2gif-master]# make install
[root@test ttyrec-1.0.8]# seq2gif -i ttyrecord -o tty.gif
[root@test ttyrec-1.0.8]# ll tty.gif
-rw-r--r--. 1 root root 28068 Jul 23 19:31 tty.gif
附录:
git clone https://github.com/saitoha/seq2gif
wget http://0xcc.net/ttyrec/ttyrec-1.0.8.tar.gz
wget https://codeload.github.com/gist/08c41b8b16ca3b969df4/zip/62767e5f3564346394f5a21bd4fe377d2e05c51c

四、结果

在Linux上录制终端的操作的更多相关文章

  1. 如何在 Linux 上录制你的终端操作

    导读 录制一个终端操作可能是一个帮助他人学习 Linux .展示一系列正确命令行操作的和分享知识的通俗易懂方法.不管是出于什么目的,从终端复制粘贴文本需要重复很多次,而录制视频的过程也是相当麻烦,有时 ...

  2. linux之shell终端使用操作快捷键

    所谓的shell终端就是桌面右键里面的打开终端那个终端 敲命令是一件很有趣的事,可是有时候我们会遇到一些很麻烦的事 例如,命令太长导致敲完后一大串字符可读性低,想把vi filename 快速改为ca ...

  3. linux文件或文件夹常见操作,排查部署在linux上程序问题常用操作

    创建文件夹 mkdir [-p] DirName [ 在工作目录下,建立一个名为 A 新的子目录 : mkdir A 在工作目录下的 B目录中,建立一个名为 T 的子目录:   若 B 目录不存在,则 ...

  4. 如何在linux下录制terminal操作?

    相关包: ttyrec: ttyrec is a tty recorder. Recorded data can be played back with the included ttyplay co ...

  5. 在Windows上使用终端模拟程序连接操作Linux以及上传下载文件

    在Windows上使用终端模拟程序连接操作Linux以及上传下载文件 [很简单,就是一个工具的使用而已,放这里是做个笔记.] 刚买的云主机,或者是虚拟机里安装的Linux系统,可能会涉及到在windo ...

  6. 提升效率的Linux终端快捷操作汇总

    很多普通 Linux 桌面用户都对使用终端感到排斥和恐惧,其实它没大家想的那么复杂,很多常见操作都可以直接在终端中进行,如:安装软件.升级系统等. 无论你是新手还是 Linux 终端使用的老鸟,系统极 ...

  7. Linux终端快捷操作汇总

    定位单词 在长段的命令中,使用 Ctrl + ← 和 Ctrl + → 可快速将光标定位到命令中单词的首字母或末尾,实现在各单词之间的快速跳动定位. 你可以试着在终端中输入 apt-get insta ...

  8. jmeter操作数据库,分布式,在Linux上运行

    jmeter操作数据库: 1.在测试计划中导入数据库jar包 2.添加链接数据库信息 3.mysql:jdc:mysql://192.168.1.116:3307/bugfree?allowMulti ...

  9. C++的标准库函数默认都是操作字节,而不是字符,非常痛苦,所以引入了u16string和u32string(Linux上的wchar_t是32位的原因,utf16对unicode的支持是有缺陷的)good

    时至今日,字符串使用unicode已经是不需要理由的常识,但对一些有着悠久历史的编程语言来说,这仍然是个头痛的问题.如果抛开第三方库的支持,C++其实并不能实际有效地支持unicode,即使是utf8 ...

随机推荐

  1. iRate快速绕坑使用

    目的 iRate库通过激励用户去AppStore打分,来帮助你提升iPhone和Mac App的质量.这是取得经常使用的目标用户的意见的最好的方式之一. 方案(小弟想说的重点) 以前,App中都是显示 ...

  2. 开发必看 | iOS开发常用设计模式!

    ios开发学习中,经常弄不清楚ios的开发模式,今天我们就来进行简单的总结和探讨~(一)代理模式 应用场景:当一个类的某些功能需要由别的类来实现,但是又不确定具体会是哪个类实现.优势:解耦合敏捷原则: ...

  3. 【PGP公钥】

    Fingerprint: 37AF 3814 3ABC 5DFA 97F5 300E 581D A2E3 F4D2 F585 Key ID:0x581DA2E3F4D2F585 -----BEGIN ...

  4. 死锁-Java代码示例

    class MyThread implements Runnable{ private Object o1 = new Object(); private Object o2 = new Object ...

  5. 《Redis设计与实现》- 复制

    在分布式系统中为了解决单点问题,通常会把数据复制多个副本部署到其他机器,满足故障恢复和负载均衡灯需求.Redis提供了复制功能,实现了相同数据多个副本,复制功能作是高可用Redis的基础,深入理解复制 ...

  6. BeanFactory和IOC控制反转

    之前在看spring,看IOC实在是云里雾里,包括看AOP也是云里雾里的,后来重新学习Java Web,做了一个简单的web项目,再之后看了崔希凡老师的视频,Day27和Day28两天的内容,真的很有 ...

  7. tcl之文件操作-文件名相关

  8. PHP Socket服务器搭建和测试

    1.socket服务器搭建思路 1) 目的:理解socket服务器工作机制 2) 思路:创建socket -> 把socket加入连接池 -> 处理接收信息 -> 握手动作 -> ...

  9. Python入门必知的几个点

    Python是Guido van Rossum在1989年圣诞节期间,为了打发无聊的圣诞节而编写的一个编程语言.全世界差不多有600多种编程语言,但流行的编程语言也就那么20来种.如果你听说过TIOB ...

  10. C语言基础篇(一)关键字

    导航: 1. 数据类型 !!! 2. 自定义类型 !!!! 3. 逻辑结构 4. 类型修饰符 !! 5. 杂项 !! ----->x<------------->x<----- ...