5

Is there a Cygwin alternative for OS X's pbcopy?

From Mac Developer Library man page

pbcopy, pbpaste - provide copying and pasting to the pasteboard (the Clipboard) 
from command line
2
  • We will need much more information to give good recommendations here – asking for "a tool like X" is never giving enough details, even if linked. You should always list your requirements explicitly. Please see How to ask for an alternative to some software and the questions linked to it for details. What is pbcopy? What features must your "alternative" have? There are people who might know exactly what you want – but cannot tell you because they don't know they know (not knowing pbcopy) ;) Please edit your post and specify.
    – Izzy
    Jun 3 '15 at 8:31
  • 1
    I've upvoted every answer here. good work, people. Nov 6 '19 at 18:48
4

Apparently Cygwin has /dev/clipboard, so you can do stuff like echo test >/dev/clipboard.

See also Fun with Cygwin's /dev/clipboard

1
4

Microsoft Windows has a native solution that you can also use in Cygwin: clip. For example:

systeminfo | clip

Further details: Microsoft TechNet.

2

I've got the following in my ~/.bash_profile, which essentially adds OS X's pbcopy and pbpaste to Cygwin:

if [ -e /dev/clipboard ]; then        
    alias pbcopy='cat >/dev/clipboard'
    alias pbpaste='cat /dev/clipboard'
fi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.