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