vykjxq
Last Updated: February 25, 2016
·
1.999K
· jacaetevha
D21ebccf20562e370eb0a8cf170a0580

pbcopy & pbpaste

I love pbcopy and pbpaste on my Macs! I use them all the time. From the man page, they "provide copying and pasting to the pasteboard (the Clipboard) from the command line." You can even copy Encapsulated PostScript and RTF using these commands.

Linux? Well, if you install the XSel utility you can have these commands there also via Shell aliasing (plain text copy/paste only):

alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'

Update (2012-11-18): You can also use the xclip utility (thanks to passcod for the suggestion):

alias pbcopy='xclip -in -selection c'
alias pbpaste='xclip -out -selection c'
Say Thanks
Respond

2 Responses
Add your response

1596
11904d2d1af36d532f9d78d9d59f6819

On Linux it's typically xclip that's used:

xclip | cat > paste/file
cat copy/file | xclip
over 1 year ago ·
1603
D21ebccf20562e370eb0a8cf170a0580

xclip is certainly an alternative, Looking at the popularity contest statistics for the two, about 29% still use xsel though. I'll update my post to include xclip information.

over 1 year ago ·
Filed Under