By Alvin Alexander. Last updated: April 30, 2017
If you ever need to copy text (or a text file) from the MacOS Terminal to the Mac clipboard, I can confirm that the macOS pbcopy
command works. It reads from STDIN and copies the text to the clipboard, so commands like these work:
$ echo "foo bar baz" | pbcopy $ cat /etc/passwd | pbcopy