Skip to main content

Copy Command Line Output to the Clipboard on Mac and Windows

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

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

Mac

cat <file> | pbcopy

Windows

type <file> | clip