爱问知识人 爱问教育 医院库

怎样记录linux操作命令日志?

首页

怎样记录linux操作命令日志?

怎样记录linux操作命令日志?

提交回答

全部答案

    2017-07-25 23:15:45
  •   在linux终端下,为方便检查操作中可能出现的错误,以及避免屏幕滚屏的限制,我们可以把操作日志记录下来。常用的工具有screen,script,以及tee等。
    1。 screen — screen manager with VT100/ANSI terminal emulatio
    > screen -L
    >这里是我们的操作
    > exit
    结束后会生成一个类似这样的文件名: screenlog。
      0 > more screenlog。0 这样可以查看你刚才进行的操作,发现可能存在的问题 2。 script — make typescript of terminal session > script >我们的操作 > exit 生成一个这样的文件:typescript > more typescript 这里查看我们进行的操作 3。
       tee – read from standard input and write to standard output and files 这个命令可以读取终端输入输出到终端或者文件中,有时候可以用来记录make等命令可能产生的输出到终端的大量内容输出到文件中去。
      这样可以方便记录这些命令的日志。 > make 2>&1 | tee make。log 当然,我们也可以直接重定向到一个文件中 > make > make。log PS: 2>&1是为了记录错误日志 if you want to filter the control symbols, try to use the “col” command like this: $ cat screenlog。
      0 | col -b > screenlog or $ cat typescript | col -b > scriptlog。

    G***

    2017-07-25 23:15:45

类似问题

换一换
  • 系统软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):