0

I tried using 2>, but it still doesn't save the error in the text file.

C:\>telnet abc 2> test.txt
Connecting To abc...Could not open connection to the host, on port 23: Connect failed
Veve
  • 6,182
  • 5
  • 37
  • 53

1 Answers1

0

Use >> to append the output of a command (for either STDOUT or STDERR) to a file:

C:>telnet abc >> test.txt
Veve
  • 6,182
  • 5
  • 37
  • 53
  • This would not redirect STDERR to the file – koukouviou Mar 20 '15 at 08:42
  • @koukouviou quoted from an answer of the question you've linked, "The >> (for either STDOUT or STDERR) will APPEND not REPLACE the file. So you get a cumulative logfile, showwing the results from all runs of the process - typically more useful." – Veve Mar 20 '15 at 08:45
  • ya. this is not work. The text.txt still showing empty – user3483446 Mar 20 '15 at 08:46