Software & Apps > Windows 35 35 people found this article helpful What Is a Redirection Operator? Change where to send a command's output by Tim Fisher VP and General Manager, Lifewire.com Tim Fisher has more than 30 years' of professional technology experience. He's been writing about tech for more than two decades and serves as the VP and General Manager of Lifewire. our editorial process Facebook Twitter LinkedIn Tim Fisher Updated on March 25, 2021 Tweet Share Email Windows The Ultimate Laptop Buying Guide A redirection operator is a special character that can be used with a command, like a Command Prompt command or DOS command, to either redirect the input to the command or the output from the command. By default, when you execute a command, the input comes from the keyboard and the output is sent to the Command Prompt window. Command inputs and outputs are called command handles. Lizzie Roberts / Getty Images Redirection Operators in Windows and MS-DOS The table below lists all of the available redirection operators for commands in Windows and MS-DOS. However, the > and >> redirection operators are, by a considerable margin, the most commonly used. Redirection Operators Cheat Sheet Redirection Operator Explanation Example > The greater-than sign is used to send to a file, or even a printer or other device, whatever information from the command would have been displayed in the Command Prompt window had you not used the operator. assoc > types.txt >> The double greater-than sign works just like the single greater-than sign but the information is appended to the end of the file instead of overwriting it. ipconfig >> netdata.txt < The less-than sign is used to read the input for a command from a file instead of from the keyboard. sort < data.txt | The vertical pipe is used to read the output from one command and use if for the input of another. dir | sort Two other redirection operators, >& and <&, also exist but deal mostly with more complicated redirection involving command handles. The clip command is worth mentioning here as well. It's not a redirection operator but it is intended to be used with one, usually the vertical pipe, to redirect the output of the command before the pipe to the Windows clipboard. For example, executing ping 192.168.1.1 | clip will copy the results of the ping command to the clipboard, which you can then paste into any program. How to Use a Redirection Operator The ipconfig command is a common way to find various network settings through Command Prompt. One way to execute it is by entering ipconfig /all in the Command Prompt window. When you do that, the results are displayed within Command Prompt and are then only useful elsewhere if you copy them from the Command Prompt screen. That is unless you use a redirection operator to redirect the results to a different place like a file. ipconfig /all > networksettings.txt If we look at the first redirection operator in the table above, we can see that the greater-than sign can be used to send the command's results to a file. This example command above is how you'd send the results of ipconfig /all to a text file called networksettings.txt. The dir command is another situation where a redirection operator is really useful. Since that command often produces results too long to read comfortably in a Command Prompt window, exporting all of it to a text document is wise. dir C:\Users\Tim\Downloads > downloads.txt In that example, all files and folders in that user's Downloads folder will be shown in the downloads.txt file. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up! Tell us why! Other Not enough details Hard to understand Submit More from Lifewire How to Redirect Command Output to a File 21 Best Command Prompt Tricks What Is a Command for Computers? Windows 7 Command Prompt Commands Ping Command How to Verify File Integrity in Windows With FCIV Dir Command Sfc Command (System File Checker) Msg Command How to Ping a Computer or a Website More Command Help Command DNS Servers: What Are They and Why Are They Used? List of Command Prompt Commands Tracert Command What Is a BAT File?