Ever wonder how to copy something from the command line into the Mac OS clipboard? If you want to copy/paste a files content (perhaps a log file or a conf file, etc) into the clipboard to use outside of the CLI, you can use the commands pbcopy and pbpaste. Example: I want to copy the contents of my public key to the clipboard (so I can send it to a server admin who will use it in allowing me to access their subversion repository).
All I would need to do is:
cat id_dsa.pub | pbcopy
(cat writes out the content and then it is piped (|) into the clipboard) This comes in handy!
I know I am working too late when my menu bar eyeballs are bloodshot. (I have been carrying around this “Extension” since Mac OS 7.)