How To Windows Redirection Operator Share Pin Email Print Lizzie Roberts / Getty Images Windows Key Concepts Computer Concepts File Types Command Line Basics Guides & Tutorials Installing & Upgrading Tips & Tricks by Tim Fisher Tim Fisher has 30+ years' professional technology support experience. He writes troubleshooting content and is the General Manager of Lifewire. Updated May 28, 2019 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. 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. 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 is how you'd send the results of ipconfig /all to a text file called networksettings: ipconfig /all > networksettings.txt Continue Reading How to Save a Command's Output to a File How to Use the Help Switch in Command Prompt What's the More Command in Windows and How Is It Used? How to Use the Ping Command in Windows How to Use the Dir Command in Windows How to Use the Format Command in Windows What Is the Command Prompt in Windows, and How Do I Open It? Do More with Windows Vista Using These CMD Commands Understanding the Linux Unix Command: bash Understanding the Linux/Unix Command bash 21 Command Prompt Tricks and Hacks Linux / Unix Command: ash How to Use the Tracert Command in Windows What You Need to Know About Commands in Windows How to Use the Help Command in Windows: Examples, Options, Switches and More What Does Syntax Mean and Why Is It Important to Understand?