OS X: Manipulating the Clipboard via Command Line

appleunix

So I somehow just found out that you can manipulate OS X’s clipboard via command line. The utility that does it is called pbcopy (and pbpaste).

[bash]echo “Lorem ipsum dolor sit amet” | pbcopy[/bash]

Now, go into any OS X application and perform the paste (⌘-v) command and you’ll have the content you placed there via command line. Or you can use the related pbpaste to output your content.

[bash]pbpaste (to wherever)[/bash]

pbcopy

Related

Related posts: