Skip to main content

Copy Command Line Output to the Clipboard on Mac and Windows

Published: 2018-10-12 • Last updated: 2021-03-11

In each example below, the contents of a file are copied to the clipboard.

# Mac

cat <file> | pbcopy

# Windows

type <file> | clip