Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的进程将一些日志信息输出到控制台窗口。当我将它作为后台进程运行时,我在哪里可以找到输出日志?
取决于过程以及您如何开始。如果它写入stdout(这很可能,因为输出通常是到终端),您可以将输出重定向到一个文件
stdout
command > logfile &
如果您还想从 记录错误消息stderr,请执行
stderr
command > logfile 2> errorlogfile &
或者
command > logfile 2>&1 &
将所有内容放在一个文件中。