Choose your dojo

Master every interface, one skill at a time

Paste Clipboard Text into a Command

What This Does

Use text from your clipboard as input to a command, turning copied text into data your terminal can work with.

Why It's Useful

Turn copied text into data. Copy a file path from Finder, an email address, or any text, then use it directly in terminal commands without retyping.

How to Do It

  1. Copy some text to your clipboard (like a file path from Finder)
  2. Use pbpaste in your command
  3. For example: cd $(pbpaste) changes to the directory you copied
  4. Or: cat $(pbpaste) displays the file whose path you copied

Try This Now

Copy a file path from Finder (right-click a file, hold Option, then choose "Copy as Pathname"). Then run ls $(pbpaste) to list that file's directory.

Mental Hook: Turn copied text into data.