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 ...
随机推荐
- 湘潭校赛 Hard Wuxing
Hard Wuxing Accepted : 13 Submit : 166 Time Limit : 1000 MS Memory Limit : 65536 KB 题目描述 “五行”是中国 ...
- 算法 - 排序数组中与x最近一点
条件: a[j] + a[j+1] < x*2 int findClosestPoint(int x,int a []) { int res = 0; int j = 0; while(j< ...
- 一个支持DbFirst、ModelFirst和CodeFirst的数据库小工具DbTool
DbTool 一个支持DbFirst.ModelFirst和CodeFirst的数据库工具. 简介 这是一个针对 SqlServer 数据库和 C# 开发语言的小工具,可以利用这个小工具生成数据库表对 ...
- Markdown预览功能不可用解决方案
初学者在使用Markdown时也许会遇到这个问题 原因是电脑缺少一个组件,解决方案很简单,安装上就好了,以下是链接 http://markdownpad.com/download/awesomium_ ...
- LOJ #2985. 「WC2019」I 君的商店
传送门 搬题解QwQ 首先最大值一定为 \(1\),直接扫一遍两两比较 \(O(2N)\) 求出最大值 设最大值位置为 \(a\),对于任意两个没有确定的位置 \(x,y\) 询问 \([a,x+y] ...
- HackerRank Special Substrings 回文树+后缀自动机+set
传送门 既然要求对每个前缀都求出答案,不难想到应该用回文树求出所有本质不同的回文子串. 然后考虑如何对这些回文子串的前缀进行去重. 结论:答案等于所有本质不同的回文子串长之和减去字典序相邻的回文子串的 ...
- 【PyQt5 学习记录】011:使用 QListWidet 创建列表
使用 QListWidet 创建列表 作者: 八月未见 博客: https://www.cnblogs.com/jmtm/ 创建列表: list_widget = QListWidget() 插入项目 ...
- thinkPHP的几个系统常量
echo "当前请求:" . __SELF__ . '<br>'; echo "当前分组:" . __MODULE__ . '<br>' ...
- <Android 基础(二十九)> Fragment (2) ~ DialogFragment
简介 上一篇简单的介绍了下Fragment的使用方法,这一篇主要看下DialogFragment. 在android 3.0时被引入.是一种特殊的Fragment,用于在Activity的内容之上展示 ...
- vue-cli中的webpack配置
编辑模式下显示正常,打开的时候不知道为啥排版有问题.segementfalut链接在这里 版本号 vue-cli 2.8.1 (终端通过vue -V 可查看) vue 2.2.2 webpack 2. ...