Trying to work with a URL from your browser in Terminal? Looking to save a full document from the clipboard to a file quickly (and process it, too)? The command line lets you do it. Find out here how to paste text from the system clipboard into Terminal on a Mac ⤓.
On This Page
How to Paste Clipboard Text into Mac Terminal
Using “pbpaste” (Directly Usable in Command-line Applications)
Time needed: 2 minutes
To paste text from the standard macOS system clipboard into the Terminal command prompt as a stream that can be redirected or piped (to a command-line app, for instance, or any file) on a Mac:
- Open or go to Terminal on your Mac.
- Type
pbpasteat the Terminal command prompt.What it does: pbpaste takes text from the system clipboard and writes it to standard output; pbpaste does to text from the clipboard what cat does to the text content of files; standard output is typically printed to the screen but importantly can also be redirected as input to other programs.
What will be pasted: You can use pbpaste or Finder to preview and monitor the Mac clipboard.
From the history: To paste from your clipboard history, do move the (previous) item you want to paste to the (current) clipboard before you use pbpaste. - To save or append the text to a file:
Saving: Add
> {filename}to write the contents of the Mac system clipboard (overwriting the current contents), replacing{filename}with the name of the file.
Appending: Add>> {filename}to add text from the clipboard to the end of the file.
Example: The full command to save the clipboard text to the file clip.txt in the current directory ispbpaste > clip.txt. - To use text from the clipboard as input for another program:
Pipe: Append |
to send text from the clipboard to a program that can use text from the standard input.
Example: usepbpaste | sed 's/[.?!]/&\n/g' | grep -i "La De Du"to first split text from the clipboard into sentences, then extract all those that contain "La De Du". - Press Enter.
Text to terminal:
Tips help fuel these email and tech how-tos.
Using the Terminal “Paste” Command (Good for Short Snippets of Text)
To paste text directly to the text input in Terminal from the system clipboard on a Mac:
- Position the text cursor where you want to paste the text.
Applications: Pasting using the Terminal command will input text from the clipboard as if you had typed it anew. - Press Command V.
Escaping: You can also have Terminal escape certain characters (including whitespace, parentheses, colons, etc.) with a backslash before pasting; press Command Control V.
Menu alternative: In the menu bar, you can also select Edit | Paste and Edit | Paste Escaped Text, of course.
Their word: Apple include information on pasting into Terminal in the Mac User Guide.
Something to paste: How to Copy Text to the Clipboard from Mac Terminal
The Terminal cursor need not blink at you: How to Turn Off Cursor Blinking on a Mac
How to Paste Clipboard Text into Mac Terminal: FAQ
Can I paste binary data (such as images) to Terminal?
No.
Using pbpaste or the Terminal app’s pasting commands, you can only paste text from the clipboard.
Can I paste formatted text?
To a very limited degree.
The pbpaste command has the option -Prefer that lets you specify rtf or ps for RTF text and encapsulated postscript respectively. It will the paste rich-text or PS-formatted text rather than the plain-text version. If no formatted text is found, pbpaste will still paste the plain text from the clipboard — and that is what typically will happen.
Example: pbpaste -Prefer rtf > ladedu.rtf saves RTF text from the clipboard to the file ladedu.rtf.
What is “Paste Selection”?
In macOS Terminal, you can copy and paste without first copying. The command Edit | Paste Selection in the menu (Command Shift V) pastes highlighted text from within Terminal.
To use it for copying text:
- Position the text cursor where you want to paste.
- Highlight text with the mouse in Terminal.
- Press Command Shift V to paste at the text cursor.
(Tested with macOS Tahoe 26.0–26.4, Sequoia 15.0–15.5, Sonoma 14.3 and Ventura 13.5; first published September 2023, last updated March 2026)