I'd like to be able to pipe output of commands from the terminal to OS X's clipboard just like I can do to pipe output of commands to files with the > operator (cat file.txt > file2.txt).

Is there any way to do this?

link|improve this question

feedback

1 Answer

up vote 4 down vote accepted

pbcopy does what you want.

http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pbcopy.1.html

pbcopy takes the standard input and places it in the specified pasteboard. If no pasteboard is specified, the general pasteboard will be used by default. The input is placed in the pasteboard as plain text data unless it begins with the Encapsulated PostScript (EPS) file header or the Rich Text Format (RTF) file header, in which case it is placed in the pasteboard as one of those data types.

link|improve this answer
Thanks for that. – esqew Aug 18 '11 at 19:11
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.