Skip to content

Pipe Terminal output straight to the clipboard — via SS64

Commandlow riskmacOS 14 Sonoma and later

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

  1. Copy a command's output: ls ~ | pbcopy.
  2. Copy a file's contents: pbcopy < notes.txt.
  3. Use the clipboard in a command: pbpaste | wc -l counts the lines you copied.

Command

Run in Terminal (Applications › Utilities).

ls ~ | pbcopy

Sources

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.

pbcopypbpasteclipboardterminalcopy

More in Hidden Tools & Commands

Download a full macOS installer from Terminal — via SS64

Commandlow risk

softwareupdate can list and download complete macOS installers, including older versions Apple still serves. Useful for making a bootable USB installer or installing on another Mac without hunting through the App Store. This entry only downloads; it doesn't install anything.