Collections:
Other Resources:
Redirect STDOUT Stream for Command to File
How to redirect STDOUT stream from the screen to a file? I want the command to send output data to a file.
✍: FYIcenter.com
By default, the STDOUT stream for a command is mapped the screen.
If the command is writing data to the STDIN stream,
you will see it on the screen.
But, you can use the ">" redirect operator to redirect the STDOUT stream from the screen to a file as shown below:
command options > file-name
For example, the "DIR" command writes a list of files and sub-directories to the STDOUT stream. By default, "DIR" writes the list to the screen. But you can redirect it to a file as shown below:
C:\fyicenter>dir \windows\System32\spool > dir.txt
Now the file dir.txt contains the output of the "DIR" command. If you open it in notepad, you see the following:
Directory of C:\windows\System32\spool
12/13/2016 11:15 AM DIR .
12/13/2016 11:15 AM DIR ..
07/13/2009 11:57 PM DIR drivers
12/12/2017 07:50 PM DIR PRINTERS
07/13/2009 10:20 PM DIR prtprocs
12/13/2016 11:14 AM DIR SERVERS
12/12/2017 09:51 AM DIR tools
0 File(s) 0 bytes
Note that the "> file-name" direction will replace old content of the file, if it is an existing file.
⇒ Redirect STDOUT Stream to the End of File
2022-12-03, ∼2668🔥, 0💬
Popular Posts:
What is the startup program "hkcmd Module - hkcmd.exe" on my Windows 8 computer? Can I remove it to ...
Can I remove startup application "SynTPLpr.exe - TouchPad Driver Helper Application" to speedup my c...
What is HelpHost.exe - Microsoft Help Center Hosting Server? HelpHost.exe is the executable binary f...
What is the installed program "Microsoft .NET Framework 4.5.1 SDK" on my Windows 7 computer? "Micros...
What are Download Program Files (DPF) for Internet Explorer (IE) 7 browser? Download Program Files (...