18
4
I need to directly copy the terminal stdout to the clipboard on Mac. How would I do this?
Example:
echo sometext | copy_to_clipboard
or
echo sometext > /private/clipboard.txt
18
4
I need to directly copy the terminal stdout to the clipboard on Mac. How would I do this?
Example:
echo sometext | copy_to_clipboard
or
echo sometext > /private/clipboard.txt
23
Use pbcopy
:
echo foo | pbcopy
Also see man pbcopy
for info on it and pbpaste
.
Or for a file, e.g. rsa key use pbcopy < ~/.ssh/id_rsa.pub – Max MacLeod – 2018-12-01T16:16:02.300
I am interested to know if it is possible to do this when ssh'ed to another box as well http://superuser.com/questions/405491/how-can-i-copy-the-output-from-a-remote-command-into-the-local-clipboard
– cwd – 2012-03-28T16:24:14.173