I apologize for being a little slow on posting for a bit now1. Here’s a quick one for the Shell Tricks series, though.

Have you ever wanted to double-check the contents of your clipboard before hitting paste in Terminal (or including pbpaste in a piped command)? A simple alias makes a quick job of it:

alias cbp="pbpaste|less"

I use cbp with the mnemonic “clipboard preview.” It simply outputs the text contents of the system-wide clipboard (as opposed to the kill buffer) to your pager without affecting the command line or the contents of the clipboard. You can also pipe to cat to just dump the contents to the screen without executing anything.

This is useful for me when I just want to verify what’s in the clipboard before pasting, without going to a clipboard manager or dumping to a text file. It’s especially useful when you’re connected to a remote OS X machine and may have copied or piped content to the system pasteboard with no access to the GUI.

By the way, I built a Jekyll plugin to make an index and actual landing pages for all the posts that I add “series” metadata to. Convenient.

  1. It’s not just the recent surgery, it’s that I’ve been working more and more on “legitimate” applications with commercial value. While I still find plenty of time to hack away at the little freebies, I’ve been running out of time and energy to write them up in detail. More coming soon, though, I promise. 

Ryan Irelan has produced a series of shell trick videos based on BrettTerpstra.com posts. Readers can get 10% off using the coupon code TERPSTRA.