How to Redirect Command Prompt Output to a File – Knowligent
How to Redirect Command Prompt Output to a File

How to Redirect Command Prompt Output to a File

HomeHow to, TechHow to Redirect Command Prompt Output to a File

Use a redirection operator to redirect the output of a command to a file. Any information displayed in the command prompt after running a command can be saved to a file, which you can refer to later or edit as needed.

Although there are several redirection operators, two in particular are used to output the results of a command to a file: the greater-than sign (>) and the double greater-than sign (>>).

The easiest way to learn how to use these redirection operators is to look at some examples:

In this example, all of the information that would normally be displayed on the screen after running ipconfig /all is saved to a file named networksettings.txt. It is saved to the directory to the left of the command, in this case the root of the D: drive.