[英]Batch file, Need to save output to text file for telnet command in windows
[英]How to save command output to a file in windows and show output on terminal also?
我想将命令的输出保存在文件中以及在终端上显示输出。
为了将输出保存到文件中,我使用以下命令:
>> ps -ef > D:\temp.txt
但这会将输出保存到文件中,但不会显示在终端上。 我应该使用哪个命令来执行这两个要求?
使用MinGW,然后使用以下命令:
ps -ef 2>&1 | tee D:\temp.txt
这将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.