When you are using the Microsoft Windows command line interface, you may need to copy the output of commands somewhere else, such as notepad or some other text editor. You can copy and paste the output of commands by right-clicking on the Command Prompt title bar and selecting Edit, then Mark and then highlighting the text you wish to copy in the command prompt window and hitting Enter to copy it to the Windows clipboard. Or you can click within the Command Prompt window below the title bar which will give you the option to select Mark without selecting Edit first. Either method will then allow you to use Edit and Paste or Ctrl-V to paste the text into other applications.
Another alternative is to redirect the output of a command to a file using
the redirect character, >
. E.g., if you wished to put
the output of the dir command in file example.txt,
you could use dir > example.txt
.
If you wish to see the output in the command window and also have it
copied to the clipboard at the same time, another alternative is to use
the "pipe" character, |
followed by clip
. E.g.,
if you wanted to see all the files in a directory with many files and also
have the output of the command placed in the Windows clipboard, you could
use dir | clip
. You could then paste the contents of
the clipboard into other applications.