pipe output to clipboard with pbcopy and pbpaste

Using terminal and needs to copy the result of command to clipboard ? use pbcopy

$ cat somefile.txt | pbcopy

Or the other way around, paste from clipboard and pipe it to other program

$ pbpaste | grep foo

Last updated