Mik*_*sta 8 windows file-transfer cmd.exe
我想将 ipconfig /all 保存到文本文件。我在 Windows 10 上。当我在 cmd 中尝试此操作时
ipconfig /all | tee file.txt
Run Code Online (Sandbox Code Playgroud)
我有
'tee' is not recognized as an internal or external command,operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
什么是 Windows 替代品tee
?
Gre*_*g W 51
尝试重定向。而不是| tee
,使用> output.txt
例如
ipconfig /all > output.txt
Run Code Online (Sandbox Code Playgroud)
Cia*_*zie 19
ipconfig /all >>logfile.txt 2>>&1
在>>logfile.txt 2>>&1
将两个输出流和错误流重定向到将要创建并保存在当前目录下一个名为LOGFILE.TXT。如果该目录中存在现有的 logfile.txt,它会将输出附加到它的末尾。
如果您安装MSYS2,您可以使用
$ ipconfig -all | tee file.txt
Run Code Online (Sandbox Code Playgroud)
请注意,/all
必须写为-all
.
就我而言,我得到:
$ head file.txt
Windows-IP-Konfiguration
Hostname . . . . . . . . . . . . : Death-Star
[..]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
14884 次 |
最近记录: |