linux记录终端软件,记录终端会话的Terminalizer工具

你有没有想过如何记录你的Linux终端? Terminalizer是一个奇特的高度可定制的CLI工具,它记录和呈现终端活动,并可以生成动画GIF图像,它可以在Ubuntu,CentOS,arch Linux,SUSE,RedHat,fedora等上运行良好,在本教程中,我们将介绍如何安装和捕获/记录Linux终端。

安装terminalizer之前,请确保安装了Node.js和npm 。

安装node.js

要安装node.js,首先更新你的系统,在这里我使用Ubuntu 18.04版本。apt update

接下来,运行下面的命令从存储库安装Node.js,apt install node.js

输出The following NEW packages will be installed:

libc-ares2 libhttp-parser2.7.1 libuv1 nodejs nodejs-doc

0 upgraded, 5 newly installed, 0 to remove and 490 not upgraded.

Need to get 5,671 kB of archives.

After this operation, 24.8 MB of additional disk space will be used.

Do you want to continue? [Y/n] Y

成功安装node.js之后,你可以使用如下命令来验证Node.js的版本,nodejs --version

输出v8.10.0

最后,我们将安装Node.js,它是的包管理器,apt install npm

验证npm运行的版本npm --version

输出3.5.2

安装terminalizer

安装terminalizer,运行npm install -g terminalizer

输出> [email protected] install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt

> prebuild-install || node scripts/install.js

Terminalizer的安装应该可以在node js版本9及以下版本中正常工作,如果运行的是更新一些的版本,安装可能会失败,则可能需要安装开发工具来构建C 附加组件。apt install build-essential

验证开发工具运行的安装gcc -v

输出Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper

OFFLOAD_TARGET_NAMES=nvptx-none

OFFLOAD_TARGET_DEFAULT=1

Target: x86_64-linux-gnu

Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-16ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

Thread model: posix

gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)make -v

输出GNU Make 4.1

Built for x86_64-pc-linux-gnu

Copyright (C) 1988-2014 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

使用Terminalizer

为了开始使用terminalizer,我们首先在当前目录中生成一个演示文件,terminalizer record demo

输出The recording session is started

Press CTRL+D to exit and save the recording

此时,在终端上运行一些命令,并按CTRL +D退出。 这会将你的记录保存为YAML文件,在本例中为demo.yml,

eff6089aec2cfadbcde7eaae70e748c6.gifThe recording data is saved into the file:

/root/demo.yml

You can edit the file and even change the configurations.

要播放记录,请运行terminalizer play demo

这将播放一个记录,显示最近运行过的几个命令的历史记录,

f5c75ed0f038b183f59a68ded027fd05.gif

从上面的例子中已经看到,terminalizer是一个方便的工具,可以用来录制你的终端,

资源引用:

保存和执行常用的linux命令,经常需要编辑的目录很深的文件,或教长的编译命令等等。使用方法:把该Q可执行文件考备份到linux上任何目录,第一次执行会被加到系统目录,以后每次执行都可以像使用系统命令一样。 1.查看保存好的命令 [root@localhost ~]# q 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop 2.执行保存好的命令 [root@localhost ~]# q 10 Stopping XAMPP for Linux 1.8.1... XAMPP: Stopping Apache with SSL... XAMPP: Stopping MySQL... XAMPP: XAMPP-ProFTPD is not running. XAMPP stopped. 3.添加新命令 [root@localhost ~]# q -a "sqlplus /sys as dba" 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop 12_____sqlplus /sys as dba 4.删除保存过的命令 [root@localhost ~]# q -d 12 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值