Pipe Terminal output straight to the clipboard — via SS64
pbcopy puts anything you send it on the clipboard, and pbpaste prints what's on the clipboard. No more selecting long Terminal output with the mouse.
Takes effect right away
The easy way
- Copy a command's output:
ls ~ | pbcopy. - Copy a file's contents:
pbcopy < notes.txt. - Use the clipboard in a command:
pbpaste | wc -lcounts the lines you copied.
Command
Run in Terminal (Applications › Utilities).
ls ~ | pbcopySources
- pbcopy — by SS64
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me
Oddbyte.Me hasn't tried this on every macOS version, so keep the undo handy.