关键词搜索

全站搜索
×
密码登录在这里
×
注册会员

已有账号? 请点击

忘记密码

已有账号? 请点击

使用其他方式登录

linux手册

linux script命令–记录终端交互会话过程

script命令可以用作交互终端会话过程的记录,保留用户输入和系统输出的全过程。以备之后查询与学习,对于初学者、保留工作记录和准备写材料的人而言,这是一个非常有用的工具

在下述语法中,输出文件是用于存储所有的上机会话过程。如果未指定输出文件,所有的会话过程将会写到当前工作目录的默认文件typescript中。

语法格式:script [参数] [文件]

常用参数:

-a 把会话记录附加到typescript文件或指定的文件后面,保留先前的内容
-c 运行指定的命令而非交互shell
-q 安静运行模式

参考实例

一个简单的会话过程记录:

[root@linuxcool ~]# script
 Script started, file is typescript
[root@linuxcool ~]# date
 Mon Sep 23 21:07:14 CST 2019
[root@linuxcool ~]# uname -r
 3.10.0-123.el7.x86_64
[root@linuxcool ~]# exit
 exit
 Script done, file is typescript
[root@linuxcool ~]# cat typescript
 Script started on Mon 23 Sep 2019 09:07:09 PM CST
[root@linuxcool ~]# date
 Mon Sep 23 21:07:14 CST 2019
[root@linuxcool ~]# uname -r
 3.10.0-123.el7.x86_64
[root@linuxcool ~]# exit
 exit
 Script done on Mon 23 Sep 2019 09:07:23 PM CST
点击QQ咨询
开通会员
上传资源赚钱
返回顶部
×
  • 微信支付
  • 支付宝付款
扫码支付
微信扫码支付
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载