Linux终端里的记录器
使用场景
- 调试会产生大量 log 的应用程序,并且需要保存到本地进行进一步分析;
- 与同事协同工作,自己将工作完成了一半,可以将操作过程记录下来,发给同事,同事可以根据记录接着工作;
- 让人远程协助你,担心对方使坏,同时也可以留下案底,最好将他的操作记录下来
如何使用 script 命令?
[alvin@VM_0_16_centos test]$ script
Script started, file is typescript
[alvin@VM_0_16_centos test]$ echo hello
hello
[alvin@VM_0_16_centos test]$ ls
test1.py test2 test2.cpp test2.py test3 test3.c test.py typescript WeixinBot wxpy wxRobot
[alvin@VM_0_16_centos test]$ exit
exit
Script done, file is typescript
[alvin@VM_0_16_centos test]$ script ~/alvin-script
Script started, file is /home/alvin/alvin-script
[alvin@VM_0_16_centos test]$ ll
total
-rw-rw-r-- alvin alvin Nov : test1.py
-rwxrwxr-x alvin alvin Dec : test2
-rw-rw-r-- alvin alvin Dec : test2.cpp
-rw-rw-r-- alvin alvin Nov : test2.py
-rwxrwxr-x alvin alvin Jan : test3
-rw-rw-r-- alvin alvin Jan : test3.c
-rw-rw-r-- alvin alvin Nov : test.py
-rw-rw-r-- alvin alvin Jan : typescript
drwxrwxr-x alvin alvin Nov : WeixinBot
drwxrwxr-x alvin alvin Nov : wxpy
drwxrwxr-x alvin alvin Nov : wxRobot
[alvin@VM_0_16_centos test]$ echo hello
hello
[alvin@VM_0_16_centos test]$ exit
exit
Script done, file is /home/alvin/alvin-script
如何使用 script 与同事协作?
[alvin@VM_0_16_centos test]$ script cooperate-job
Script started, file is cooperate-job
[alvin@VM_0_16_centos test]$ echo this is alvin_s job
this is alvin_s job
[alvin@VM_0_16_centos test]$ ls
cooperate-job test1.py test2 test2.cpp test2.py test3 test3.c test.py typescript WeixinBot wxpy wxRobot
[alvin@VM_0_16_centos test]$ exit
exit
Script done, file is cooperate-job
[alvin@VM_0_16_centos test]$ script -a cooperate-job
Script started, file is cooperate-job
[alvin@VM_0_16_centos test]$ echo this is harry_s job
this is harry_s job
[alvin@VM_0_16_centos test]$ pwd
/home/alvin/test
[alvin@VM_0_16_centos test]$ exit
exit
Script done, file is cooperate-job
请他人远程协助时,如何记录他的操作过程?
vim ~/.bash_profile
/usr/bin/script -qa your_path #补齐自己的路径
Last login: Fri Jan :: from 119.33.28.6
Script started, file is /home/alvin/test/script-file #提示
[alvin@VM_0_16_centos ~]$
Linux终端里的记录器的更多相关文章
- script —— 终端里的记录器
当 你在终端或者控制台工作时,你可能想要记录在终端中所做的一切.这些记录可以用来当作史料,保存终端所发生的一切.比如说,你和一些Linux管理员们同 时管理着相同的机器,或者你让某人远程登陆到了你的服 ...
- Linux终端复用神器-Tmux使用梳理
Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权.使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后,在其中可以开启多个控制台而无需再“ ...
- Linux终端记录神器
我们在调试程序的时候,免不了要去抓一些 log ,然后进行分析.如果 log 量不是很大的话,那很简单,只需简单的复制粘贴就好.但是如果做一些压力测试,产生大量 log ,而且系统内存又比较小(比如嵌 ...
- 谁需要GUI?快看Linux 终端生存之道
完全在 Linux 终端中生存并不容易,但这绝对是可行的. 处理常见功能的最佳 Linux shell 应用 你是否曾想像过完完全全在 Linux 终端里生存?没有图形桌面,没有现代的 GUI 软件, ...
- 如何在 Arch Linux 的终端里设定 WiFi 网络
如果你使用的是其他 Linux 发行版 而不是 Arch CLI,那么可能会不习惯在终端里设置 WiFi.尽管整个过程有点简单,不过我还是要讲一下.在这篇文章里,我将带领新手们通过一步步的设置向导,把 ...
- securecrt中vim行号下划线问题及SecureCRT里root没有高亮的设置,修改linux终端命令行颜色
背景:在用raspberry用SecureCRT下的vim打开文件时出现用set nu时行有下划线,于是找了下解决办法,如下:vim行号下划线问题在vim中发现开启显示行号(set number) ...
- linux终端terminal个性化配置(转)
http://blog.csdn.net/pipisorry/article/details/39584489 {本文介绍Linux终端字体颜色设置.终端提示符显示内容设置.自定义alias命令} l ...
- Linux终端杀手、程序员利器-Tmux
Send article as PDF SA.Coder.经常远程.还在开一堆终端?试试 Tmux 吧,一个窗口就搞定. 目录 0.0.0.1 Tmux ? Tmux 是一个终端复用 ...
- 在 Mac OS X 终端里使用 Solarized 配色方案
MacOS X 终端solarized配色 相信长期浸泡在终端和代码的小伙伴们都有一套自己喜爱的配色方案.以前一直在用简单.适合阅读的 Terminal.app 配色方案,换到 MacBook Pro ...
随机推荐
- python可视化基础
常用的python可视化工具包是matplotlib,seaborn是在matplotlib基础上做的进一步封装.入坑python可视化,对有些人来说如同望山跑死马,心气上早输了一节.其实学习一门新知 ...
- WIN2008服务器不能复制粘贴怎么办
在任务管理器界面,选择进程,找到rdpclip.exe进程. 找到该进程后,点击结束进程. 然后点击WINDOWS任务管理器左上角的[文件]—[新建任务]. 在编辑框内输入rdpclip. ...
- 设计模式--单例模式(学习Learning hard大神笔记实践)
根据大神博客园中的文章,自己亲手敲了一遍,对每个解说点都自己动手进行实践,收获颇丰,谢谢Learning hard大神,原文地址http://www.cnblogs.com/zhili/p/Desig ...
- JSONP 教程
JSONP 教程 本章节我们将向大家介绍 JSONP 的知识. Jsonp(JSON with Padding) 是 json 的一种"使用模式",可以让网页从别的域名(网站)那获 ...
- 文档类型、DOCTYPE切换和浏览器模式
DTD(文档类型定义)是一种机器可读的规则,它们定义XML或HTML的特定版本中允许有什么.不允许有什么.在解析网页时,浏览器将使用这些规则检查页面的有效性并且采取相应的措施.浏览器通过分析页面的DO ...
- Elixir 学习资源
http://segmentfault.com/blog/lds/1190000002458978
- Error:Execution failed for task ':app:preDebugAndroidTestBuild'.错误解决
在新建布局文件的时候,页面显示: design editor is unavailable until a successful build(设计编辑器不可用,直到成功创建.) 细看下面还有一行错误: ...
- redis介绍(3)RDB和AOF原理解析
简单科普一下redis的概念:(会的可忽略) Redis的概念 redis基于内存的Key Value类型的NoSQL数据库. Redis的特点 1. Redis是一个高性能的Key/Value数据库 ...
- 在 Azure 中备份 Linux 虚拟机
可以通过定期创建备份来保护数据. Azure 备份可创建恢复点,这些恢复点存储在异地冗余的恢复保管库中. 从恢复点还原时,可以还原整个 VM,或只是还原特定的文件. 本文介绍如何将单个文件还原到运行 ...
- 安卓 USB摄像头 开源库 UVCCamera 教程
https://github.com/saki4510t/UVCCamera UVCCamera 听名字就知道使用UVC( USB VEDIO CLASS) 协议的通用类库.linux原生支持,基本支 ...