Pipe any data into pbcopy to put it into the clipboard. echo '123' | pbcopy Paste from the clipboard into stdout. echo `pbpaste`