Save text to Mac OS X Clipboard from the shell

Simple, use pbcopy.

Example


echo "some text" | pbcopy

or


cat file.txt | pbcopy

Now the text is available in your clipboard.
To paste, you can use command+V, or:


pbpaste

Enjoy ;-)

Leave a Reply