运维经–目录
script字符录屏工具
1.选项
Usage:
script [options] [file]
Make a typescript of a terminal session.
Options:
-a, --append append the output
-c, --command <command> run command rather than interactive shell
-e, --return return exit code of the child process
-f, --flush run flush after each write
--force use output file even when it is a link
-q, --quiet be quiet
-t, --timing[=<file>] output timing data to stderr (or to FILE)
-V, --version output version information and exit
-h, --help display this help and exit
2.录制
$ script -t 2> timing.log -a output.session
录制完成后键入exit
退出录制。
3.回放
$ scriptreplay timing.log output.session
4.共享命令行
1)先创建管道pipe文件
$ mkfifo scriptfifo
$ ll
总用量 0
prw-r--r-- 1 frank frank 0 2月 15 12:19 scriptfifo
2)演示侧输入
$ script -f scriptfifo
3)观看测输入
cat scriptfifo