歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> 在Linux上錄制終端的操作

在Linux上錄制終端的操作

日期:2017/3/3 11:05:23   编辑:Linux技術
一、安裝基礎軟件包
[root@test software]# yum install libMagickCore libMagickWand libjpeg-turbo-devel libjpeg-turbo libpng-devel compat-glibc-headers libbsd-devel xdotool -y
二、安裝ttyrec
[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
[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 clonehttps://github.com/saitoha/seq2gif wgethttp://0xcc.net/ttyrec/ttyrec-1.0.8.tar.gz wget四、結果' target='_blank'>https://codeload.github.com/gist/08c41b8b16ca3b969df4/zip/62767e5f3564346394f5a21bd4fe377d2e05c51c[/code]四、結果 

Copyright © Linux教程網 All Rights Reserved