庆典重定向标准错误时间命令? [英] bash redirect stderr for time command?

查看:93
本文介绍了庆典重定向标准错误时间命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与标准错误正在运行使用的时间命令的应用程序。我想要的应用程序的输出重定向到/ dev / null,则重定向到一个日志中的错误,都和定时重定向到一个日志中。

An application with stderr is being run using the time command. I want the output of the application to be redirected to /dev/null, the stderr redirected to a log, and the timing redirected to a log.

执行以下命令:

time cmd args >/dev/null 2>log

重定向CMD,但不与定时的时间命令

redirects the cmd, but not the time command with the timings.

推荐答案

如果你的目标是夺取时间输出到日志文件,然后使用:

If your goal is to capture the time output to the log file, then use:

{ time seq 1000 >/dev/null; } 2>log

这篇关于庆典重定向标准错误时间命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆