---
title: Preview the OS X clipboard in Terminal
date: 2014-12-11 09:35
slug: preview-the-os-x-clipboard-in-terminal
categories:
- Code
tags:
- terminal
- shell
---

I apologize for being a little slow on posting for a bit now[^legit]. Here's a quick one for the [Shell Tricks series](/series/bash-fun/), though.

[^legit]: 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.

![](https://brettterpstra.com/uploads/2014/12/clipboard-icon.png)

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](http://brettterpstra.com/series/) for all the posts that I add "series" metadata to. Convenient.

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
