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 ...
随机推荐
- myBatis组件之缓存实现及使用
一 .概述 先讲缓存实现,主要是mybatis一级缓存,二级缓存及缓存使用后续补充 Mybatis缓存的实现是基于Map的,从缓存里面读写数据是缓存模块的核心基础功能:除核心功能之外,有很多额外的附加 ...
- spring事务注解失效问题
问题描述: 由于工作需要,需要在spring中配置两个数据源,有一天突然发现@Transactional注解失效 环境框架: springmvc+spring+spring jdbcTemplate ...
- js静态数据分页展示
拿vue做示例 首先定义data data() { return { tableData: [], // 当前页的数据,用于给表格展示用的 tableDataAll: [], // 需要拿来分页的总数 ...
- CodeForces765C
C. Table Tennis Game 2 time limit per test:2 seconds memory limit per test:512 megabytes input:stand ...
- python中类的约束和限制对象添加属性
通过__slots__限制对象可添加的属性 class A: __slots__ = ['a', 'b'] pass a1 = A() a1.a = 10 print(a1.a) a1.c = 0 # ...
- maven学习知识点汇总
1. 2.maven自动建立目录骨架 首先进入目录结构: PS C:\WINDOWS\system32> cd C:\Users\10563\Desktop\test 然后输入自动构建命令: ...
- Windows 安装 python MySQLdb模块
pip install wheel 去这个网站查找whl格式的MYSQL-python http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python ...
- SQLSERVER性能计数器的简单剖析
SQLSERVER性能计数器的简单剖析 今晚看了这篇文章:SQL Server 2012新performance counter:非常实用的Batch Resp Statistics 文章里介绍到SQ ...
- MYSQL 的rownum
mysql> SELECT @rownum:=@rownum+1 AS rownum, FLIGHTS.FLTID FROM (SELECT @rownum:=0) r, FLIGHTS lim ...
- Redis 处理客户端连接的一些内部实现机制
本文主要介绍了 Redis 处理客户端连接的一些内部实现机制,包括连接处理.超时.缓冲区等一系列内容. 注:本文所述内容基于 Redis2.6 及以上版本. 连接的建立 Redis 通过监听一个 TC ...