Redirecting output to multiple files and to stdout

2019-05-04 23:20发布

I would like to redirect the output from a command to a file and to stdout. I am using Windows XP command line.

I realize that there is a command in linux called tee which will do this, but I want this in windows.

5条回答
Lonely孤独者°
2楼-- · 2019-05-04 23:56
Evening l夕情丶
3楼-- · 2019-05-04 23:56

The first hit when googling windows tee gives UNIX-style tee utility for Windows

查看更多
三岁会撩人
4楼-- · 2019-05-05 00:02

If using tee (one of the various Windows variants) isn't an option and the command isn't long-running or you don't need to do further processing of the output in real time, then

command > file && type file

would do that for you. But only under the mentioned circumstances. You're probably be better off using tee.

查看更多
家丑人穷心不美
5楼-- · 2019-05-05 00:03

The simple DOS shell doesn't have the ability to do this simultaneously.
Try using:

Windows PowerShell

or

Cygwin

查看更多
再贱就再见
6楼-- · 2019-05-05 00:03

PowerShell has tee-object (standard alias tee) if you are using a decent shell.

查看更多
登录 后发表回答