记录linux操作命令日志
|
在linux终端下,为方便检查操作中可能出现的错误,以及避免屏幕滚屏的限制,我们可以把操作日志记录下来。常用的工具有screen,script,以及tee等。 1. screen screen manager with VT100/ANSI terminal emulatio > screen -L 2. script make typescript of terminal session > script 3. tee read from standard input and write to standard output and files 这个命令可以读取终端输入输出到终端或者文件中,有时候可以用来记录make等命令可能产生的输出到终端的大量内容输出到文件中去。这样可以方便记录这些命令的日志。 > make 2>&1 | tee make.log PS: 2>&1是为了记录错误日志 $ cat screenlog.0 | col -b > screenlog or $ cat typescript | col -b > scriptlog 源代码网供稿. |
