Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .