Source
pbcopy – (p)aste(b)oard copy
$ pbcopy < file.txt # Copies the contents of the file.txt file to your clipboard
Explanation
As the pbcopy Man Page webpage explains: “Takes the standard input and places it in the specified pasteboard. If no pasteboard is specified, the general pasteboard will be used by default.”
Result
The contents of the file will be copied to your clipboard to paste wherever you require the copied text to be pasted in.
