When I started using OS X, I found the pbcopy and pbpaste command line utilities to be indispensable and an integral part of my workflow. These utilities allow me to interact with the system clipboard in a unixy, file-oriented manner that works really well with pipes and redirection, reducing my need to reach for the mouse to copy or paste.
On systems other than OS X, this functionality can be recreated using an X11 tool called xsel which is easily available on most unix systems with X11, including Linux and BSD. I use the following two aliases which behave like the OS X commands:
alias pbcopy='xsel --clipboard --input' alias pbpaste='xsel --clipboard --output'
I share a common dotfiles set up between systems which includes my bash aliases. Since these aliases are not useful on OS X, I use the following block to add the aliases on non-OS X systems:
# Simulate OSX's pbcopy and pbpaste on other platforms if [ ! $(uname -s) = "Darwin" ]; then alias pbcopy='xsel --clipboard --input' alias pbpaste='xsel --clipboard --output' fi