Skip to main content

Copy command line output to the clipboard on Mac and Windows

Published: 2018-10-12 | Lastmod: 2019-05-08

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

Mac

cat <file> | pbcopy

Windows

type <file> | clip