12
1
I would like to send the contents of a text file to the OS X clipboard.
Does Mac OS X have a built in way to do this, or will I have write a script to do this myself?
Or in other words, how do I access the clipboard from the command line?
12
1
I would like to send the contents of a text file to the OS X clipboard.
Does Mac OS X have a built in way to do this, or will I have write a script to do this myself?
Or in other words, how do I access the clipboard from the command line?
5
Nevermind, figured it out.
pbcopy < filename
#copies contents of a text, rtf, or eps file to the clipboard
pbpaste
#pastes content of clipboard to stdout
2
Yep, that's the way to go. Of course, you can also pipe output into it, ie, echo "test" | pbcopy
.
1That's awesome. Where did you find this info, and are there other cool conduits between CLI world and GUI world? – slim – 2008-09-18T19:32:23.680
@slim Just, for example, google the title of the question – Matteo – 2014-05-04T14:47:11.477