Home > Apple, Uncategorized, unix > Mac OSX – copy terminal output to clipboard

Mac OSX – copy terminal output to clipboard


Here’s a quick tip: If you want the results of some shell computation to be accessible to your clipboard (e.g. so you can paste the results into an e-mail or into some pastebin service), you can pipe the command into the `pbcopy` program.

echo "Hello world" | pbcopy
# "Hello world" is now in your clipboard

Apparently there is a way to do a similar thing on Ubuntu as well

Categories: Apple, Uncategorized, unix Tags: , , , , ,
  1. richoh
    March 28, 2012 at 12:40 am

    Protip: The contents of a file named “Hello World” are now on the clipboard. I think you mean echo “Hello World”

    • i82much
      March 28, 2012 at 2:01 am

      Thanks – good catch. Updated the post.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: