Linux下make命令的错误日志
我正在编译一个内核模块,它有很多编译错误。运行“make”后,抛出的错误太多,屏幕无法显示。向上滚动不会到达第一个错误。我尝试通过执行 make &2 > 来捕获错误log 不起作用(日志文件为空,错误消息仍然转储在屏幕上)。
有人可以告诉我如何将编译/制作期间生成的所有消息记录到日志文件中吗?
I am compiling a kernel module and it has many compilation errors in it. After running "make", the errors thrown out are too many to fit in the screen. Scrolling up doesn't reach the first error. I tried capturing the errors by doing make &2 > log which didn't work (log file was empty and the error messages were still dumped on screen).
Can someone please tell me how to go about logging all the messages generated during compilation/make into a logfile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您也想观看它滚动过去:
(/bin/sh、bash 和相关)这会将标准错误发送到与标准输出相同的位置,然后通过 tee 将它们传送到捕获结果并仍然获得屏幕操作。
If you want to watch it scroll past, too:
(/bin/sh, bash and related) This sends the standard error to the same place as the standard output, then pipes them through tee to capture the result and still get screen action.
尝试执行以下操作:
>
后面的&
告诉 shell 将 stdout 和 stderr 转储到log
中。这也可以与管道一起使用。Try doing:
the
&
after the>
tells the shell to dump both stdout and stderr to thelog
. This can also be used with pipes.