pipe output to clipboard with pbcopy and pbpaste
$ cat somefile.txt | pbcopy$ pbpaste | grep fooLast updated
Using terminal and needs to copy the result of command to clipboard ? use pbcopy
$ cat somefile.txt | pbcopyOr the other way around, paste from clipboard and pipe it to other program
$ pbpaste | grep fooLast updated