benlowery

Copy to clipboard from command line

In Computers, Mac on Nov 25 2008. 1 comment. Add your own.

I just discovered a couple useful command-line tools on OSX and thought I’d share. pbcopy will copy stdin to the clipboard and pbpaste will send the clipboard to stdout.

$ cat somefile.txt | pbcopy #copy a file to the clipboard
$ grep foo < pbpaste #search the clipboard for foo

Handy.

Related posts:

  1. Commands
  2. Using post-build events to make your own app.config
  3. In Git, Branches Are Just Names
  4. Playing with A9
  5. Finding those damn trailing commas

One Response to “Copy to clipboard from command line”

  1. pc accessories

    Nice article, i love it, thanks for sharing

Leave a Reply