All Modules / Module 7 / Lesson 4 of 4

One-line commands you can run repeatedly

3 minute read

Use What You've Copied

pbpaste outputs whatever's on your clipboard. This is powerful when combined with other commands.

Examples

1

Go to a folder path you copied elsewhere:

cd $(pbpaste)
2

Open a URL you copied:

open $(pbpaste)
3

Save clipboard to a file:

pbpaste > notes.txt

What's $()? It runs the command inside and uses the result. So $(pbpaste) gets replaced with your clipboard contents.

Key Takeaway

$(pbpaste) uses your clipboard in any command. Copy something anywhere, use it in Terminal instantly.