If you want to copy the result of any command in the terminal in your Mac to clipboard. For example if you need to use that info in a Pages document, or to paste it in your blog or forum. Use
Just pipe the output of the command in the terminal to
pbcopy and they will directly to Mac's clipboard.
ls | pbcopy
echo "Copy this into Mac's clipboard" | pbcopy
If you then need to paste it into a file also using the terminal, use
pbpaste > ~/some-file.txt