命令行操作记录工具

script工具可以记录shell回话。

在命令行输入“script”,系统将会提示"Script started,file is typesctript"。接下来随便输入几个命令,用户在命令行的操作会自动保存在typesctript文件中。

使用exit命令终止script会话。用"cat typescript"来显示之前记录的内容。

例如::~$ script
脚本已启动,文件为 typescript
:~$ ls -l /bin |head -5
总用量 11136
-rwxr-xr-x. 1 root root 1045704 6月  24  2016 bash
-rwxr-xr-x. 1 root root   34888 5月   4  2016 bunzip2
-rwxr-xr-x. 1 root root 1996936 8月  24 03:36 busybox
-rwxr-xr-x. 1 root root   34888 5月   4  2016 bzcat
:~$ exit
exit
脚本完成,文件为  typescript
:~$ cat typescript
脚本启动于 2016年12月27日 星期二 22时09分18秒
:~$ ls -l /bin |head -5
总用量 11136
-rwxr-xr-x. 1 root root 1045704 6月  24  2016 bash
-rwxr-xr-x. 1 root root   34888 5月   4  2016 bunzip2
-rwxr-xr-x. 1 root root 1996936 8月  24 03:36 busybox
-rwxr-xr-x. 1 root root   34888 5月   4  2016 bzcat
:~$ exit
exit


脚本完成,于 2016年12月27日 星期二 22时09分55秒
:~$ 

以上是完整的演示。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值