Is it possible to capture bash output to the OS X clipboard?
+10
A:
The pbcopy command does this.
For example, this puts the output from ls
on the clipboard/pasteboard:
ls | pbcopy
And pbpaste does the reverse, writing to stdout from the clipboard:
pbpaste > ls.txt
You can use both together to filter content on the clipboard - here's a rot13:
pbpaste | tr 'a-zA-Z' 'n-za-mN-ZA-M' | pbcopy
martin clayton
2009-11-18 01:50:46
mind-bogglingly useful. Oh, and pbpaste does the opposite.
LymanZerga
2009-11-18 01:54:05
@LymanZerga - edited in as you posted:)
martin clayton
2009-11-18 01:55:00
awesome. thank you so much. this is awesome.
Stephen Handley
2009-11-19 19:05:16