CLIP.EXE – copy text from command line to clipboard
10 Sep 2010Copy Output from Command Line Applications to the Clipboard
To copy text from a command to the clipboard, we’ll just pipe it into the clip command, like this:
clip |
For example, if you wanted to output from the echo command into the clipboard, you could do this:
You can also use redirection to send a text file directly into the clip utility, like this:
clip < filename.txt
In this example I’m gonna put the contents of the single.php file onto the clipboard:
Of course, you could also use the type command and then pipe it to the clipboard like so:
(source howtogeek)