How to save ipconfig output to text file when `tee` isn't available on Windows?
Solution 1:
Try redirection. Instead of | tee
, use > output.txt
e.g.
ipconfig /all > output.txt
Solution 2:
ipconfig /all >>logfile.txt 2>>&1
The >>logfile.txt 2>>&1
will redirect both output stream and error stream to a file called logfile.txt that will be created and stored in the current directory. If there is an existing logfile.txt in that directory it will append the output to the end of it.
Solution 3:
If you install MSYS2 you can use
$ ipconfig -all | tee file.txt
Note that /all
has to be written as -all
.
In my case I get:
$ head file.txt
Windows-IP-Konfiguration
Hostname . . . . . . . . . . . . : Death-Star
[..]