Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

pbcopy does what you want.

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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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