You can access the clipboard from the Mac OSX command line with a set of copy and paste commands.
Mac OSX Copy and Paste Commands
|pbcopy||Copy to Clipboard|
|pbpaste||Paste from Clipboard|
Mac OSX Command Line Copy
To add the standard output from any other command to the clipboard, pipe it to the
and then paste it in your GUI applications wherever you need.
Mac OSX Command Line Paste
To paste text from the clipboard to the standard output stream, use the
and the clipboard text will be printed out in your terminal window.
If you’d like to do more with it, you can pipe the clipboard data to any other application that accepts the standard input stream. For instance, to create paginated output from a large block of text, you can pipe it to
Kudos to Chealion on apple.stackexchange.com.