<http://schema.org/articleBody>
"&amp;lt;p&amp;gt;Many &amp;lt;a href=&amp;quot;https://www.lifewire.com/list-of-command-prompt-commands-4092302&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;1&amp;quot;&amp;gt;Command Prompt commands&amp;lt;/a&amp;gt;, and &amp;lt;a href=&amp;quot;https://www.lifewire.com/dos-commands-4070427&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;2&amp;quot;&amp;gt;DOS commands&amp;lt;/a&amp;gt; for that matter, are executed not just to &amp;lt;em&amp;gt;do&amp;lt;/em&amp;gt; something, but to provide you with information.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The &amp;lt;a href=&amp;quot;https://www.lifewire.com/ping-command-2618099&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;3&amp;quot;&amp;gt;ping command&amp;lt;/a&amp;gt;, &amp;lt;a href=&amp;quot;https://www.lifewire.com/dir-command-4050018&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;4&amp;quot;&amp;gt;dir command&amp;lt;/a&amp;gt;, &amp;lt;a href=&amp;quot;https://www.lifewire.com/tracert-command-2618101&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;5&amp;quot;&amp;gt;tracert command&amp;lt;/a&amp;gt;, and several others come to mind when I think of popular &amp;lt;a href=&amp;quot;https://www.lifewire.com/what-is-a-command-2625828&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;6&amp;quot;&amp;gt;commands&amp;lt;/a&amp;gt; that produce a lot of data in the &amp;lt;a href=&amp;quot;https://www.lifewire.com/command-prompt-2625840&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;7&amp;quot;&amp;gt;Command Prompt&amp;lt;/a&amp;gt; window.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Unfortunately, three hundred lines of information from the dir command doesn&amp;amp;#39;t do you much good as it rushes by. Yes, the&amp;lt;a href=&amp;quot;https://www.lifewire.com/more-command-4041467&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;8&amp;quot;&amp;gt; more command&amp;lt;/a&amp;gt; can be helpful here, but what if you want to look at the output later, or send it to a tech support group, or use it in a spreadsheet, etc.?&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;This is where a &amp;lt;a href=&amp;quot;https://www.lifewire.com/redirection-operator-2625979&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;9&amp;quot;&amp;gt;redirection operator&amp;lt;/a&amp;gt; becomes very useful. Using a redirection operator, you can &amp;lt;em&amp;gt;redirect&amp;lt;/em&amp;gt; the output of a command to a file. It&amp;amp;#39;s one of my favorite &amp;lt;a href=&amp;quot;https://www.lifewire.com/command-prompt-tricks-and-hacks-2618104&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;10&amp;quot;&amp;gt;Command Prompt Tricks &amp;amp;amp; Hacks&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;In other words, all the information that&amp;amp;#39;s displayed in the Command Prompt after running a command can instead be saved to a file which you can open in Windows to reference later or manipulate however you like.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;While there are several redirection operators, which you can read in detail about &amp;lt;a href=&amp;quot;https://www.lifewire.com/redirection-operator-2625979&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;11&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;, two in particular are used to output the results of a command to a file: the greater-than sign, &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt;, and the double greater-than sign, &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The easiest way to learn how to use these redirection operators is to see some examples:&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;\n&amp;lt;strong&amp;gt;ipconfig /all &amp;amp;gt; mynetworksettings.txt&amp;lt;/strong&amp;gt;\n&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;In this example, I save all the network configuration information that I&amp;amp;#39;d usually see on screen after running &amp;lt;strong&amp;gt;ipconfig /all&amp;lt;/strong&amp;gt; to a file by the name of &amp;lt;strong&amp;gt;mynetworksettings.txt&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;As you can see, the &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt; redirection operator goes between the ipconfig command and the name of the file I want to store the information in. If the file already exists, it&amp;amp;#39;ll be overwritten. If it doesn&amp;amp;#39;t already exist, it will be created.&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;\n&amp;lt;strong&amp;gt;ping 10.1.0.12 &amp;amp;gt; &amp;amp;#34;C:\\Users\\Tim\\Desktop\\Ping Results.txt&amp;amp;#34;&amp;lt;/strong&amp;gt;\n&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;Here, I execute the ping command and output the results to a file by the name of &amp;lt;strong&amp;gt;Ping Results.txt&amp;lt;/strong&amp;gt; located on my desktop, which is at &amp;lt;strong&amp;gt;C:\\Users\\Tim\\Desktop&amp;lt;/strong&amp;gt;. I wrapped the entire file path in quotes because there was a space involved.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Remember, when using the &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt; redirection operator, the file I specify is created if it doesn&amp;amp;#39;t already exist and is overwritten if it does exist.&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;\n&amp;lt;strong&amp;gt;ipconfig /all &amp;amp;gt;&amp;amp;gt; \\\\server\\files\\officenetsettings.log&amp;lt;/strong&amp;gt;\n&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;This example uses the &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt; redirection operator which functions in much the same way as the &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt; operator, only instead of overwriting the output file if it exists, it appends the command output to the end of the file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;So let&amp;amp;#39;s say the first time you use this command is on Computer A. The &amp;lt;strong&amp;gt;officenetsettings.log&amp;lt;/strong&amp;gt; file is created and the result of &amp;lt;strong&amp;gt;ipconfig /all&amp;lt;/strong&amp;gt; on Computer A is written to the file. Next you run the same command on Computer B. This time, however, the result is &amp;lt;em&amp;gt;added&amp;lt;/em&amp;gt; to the &amp;lt;strong&amp;gt;officenetsettings.log&amp;lt;/strong&amp;gt; so the network information from &amp;lt;em&amp;gt;both&amp;lt;/em&amp;gt; Computer A and Computer B are included in the file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;As you might have already realized, the &amp;lt;strong&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/strong&amp;gt; redirection operator is really useful when you&amp;amp;#39;re collecting similar information from multiple computers or commands and you&amp;amp;#39;d like all of that data in a single file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If you&amp;amp;#39;re still confused about command redirection, check out my &amp;lt;a href=&amp;quot;https://www.lifewire.com/get-more-help-2625173&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;12&amp;quot;&amp;gt;Get More Help&amp;lt;/a&amp;gt; page for information about contacting me on social networks or via email, posting on tech support forums, and more. I&amp;amp;#39;d be happy to answer any questions you have.&amp;lt;/p&amp;gt;"^^<http://www.w3.org/2001/XMLSchema#string>
<https://www.lifewire.com/how-to-redirect-command-output-to-a-file-2618084>