I just discovered a couple useful command-line tools on OSX and thought I’d share. pbcopy will copy stdin to the clipboard and pbpaste will send the clipboard to stdout.
$ cat somefile.txt | pbcopy #copy a file to the clipboard $ pbpaste | grep foo #search the clipboard for foo
Handy.