【Ubuntu】ubuntu工具 记录shell终端的内容到文件中:script

142 篇文章 25 订阅 ¥69.90 ¥99.00
本文介绍了Ubuntu系统中使用'script'命令记录shell终端内容的方法,包括如何开始记录、指定输出文件、使用不同选项如'-a'追加内容、'-c'执行命令等。通过'script',你可以将终端交互过程完整保存为typescript或指定文件,方便回顾和教学。
摘要由CSDN通过智能技术生成

###用法
$ script -h

Usage:
script [options] [file]

Options:
-a, --append append the output
-c, --command run command rather than interactive shell
-r, --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[=] output timing data to stderr (or to FILE)
-V, --version output version information and exit
-h, --help display this help and exit
-a 选项 ,在现有输出录制的文件的内容上追加新的内容
-c选项 ,后面可以加上需要执行的命令,而不是交互式shell上执行的命令
-r选项 , 子进程中返回退出代码
-f选项 , 如果需要在输出到日志文件的同时,也可以查看日志文件的内容,可以使用 -f 参数。PS:可以用于教学,两个命令行接-f可以实时演示
-q选项 ,可以使script命令以静默模

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郭老二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值