在 Bash 中重定向 stderr 和 stdout [英] Redirect stderr and stdout in Bash

查看:32
本文介绍了在 Bash 中重定向 stderr 和 stdout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重定向标准输出标准错误 单个文件的进程.我如何在 Bash 中做到这一点?

I want to redirect both standard output and standard error of a process to a single file. How do I do that in Bash?

推荐答案

看一看 这里.应该是:

yourcommand &> filename

它将标准输出和标准错误都重定向到文件 filename.

It redirects both standard output and standard error to file filename.

这篇关于在 Bash 中重定向 stderr 和 stdout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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