【问题标题】:Save linux console output in txt. file [duplicate]将 linux 控制台输出保存在 txt 中。文件[重复]
【发布时间】:2019-02-08 15:15:40
【问题描述】:

我只是在我的 linux 服务器上运行一个assetto corsa 服务器,我想知道如何“捕获”我的控制台的输出并将其保存在一个 txt 文件中。 (因为AC没有日志系统,但是控制台输出了不错的信息)

【问题讨论】:

标签: linux logging server console capture


【解决方案1】:

如果您想捕获控制台的输出,同时在控制台上看到它:

someCommand | tee --append someFile.txt 

如果你想在 .txt 文件中打印它发生的错误信息:

someCommand 2>&1 | tee --append someFile.txt

【讨论】:

  • 您能看到控制台并同时将其写入文件吗?
  • 据我记忆,没有
  • 无论如何,谢谢,西莫。拯救了我的一天:D
猜你喜欢
  • 2023-02-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多