Use "pbcopy" to copy content of file to your clipboard.
$ pbcopy < file.txt
the command will copy all content from "file.txt" directly on your clipboard.
You can check if the content is there by using the "pbpaste" command:
The content of "file.txt" will appear on your terminal window.
If you use other *nix distribution please take a look over xclip or xsel. Take look over this website: