Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like to use /dev/clipboard for moving content easily between Windows and Cygwin's command-line tools. It seems like Cygwin has problems with large clipboard contents, though. I get an error like this when I try to access /dev/clipboard after copying a large amount of text on the Windows side:

$ wc -c /dev/clipboard
wc: /dev/clipboard: Bad address
573440 /dev/clipboard

Is there a fixed buffer size for the clipboard that I can somehow increase? Or is this some other issue entirely?

share|improve this question
How much is a lot in your case i.e. at what amount of data does it struggle? The example you show above shows ~560kB, but I just tried with 8 megs and it seemed to work just fine. Also, just for curiosity's sake, could you try using getclip and putclip instead of handling the /dev/clipboard device and see if that makes any difference? I doubt it, they probably do the exact same thing, but I'm curious. cat large.txt | putclip ; getclip | wc -c – Costa Feb 15 '13 at 14:51
I played around in Notepad for a bit, and found that at 16384 characters, it works fine. At 16385 characters, it breaks with the "Bad address" error. I tried getclip and putclip, though, and those worked fine with even 100 MB of text! Put that in as the answer and I'll accept it. – John Sprad Feb 15 '13 at 16:57
up vote 0 down vote accepted

I'm not sure why the /dev/clipboard device is problematic for you, but I do know that using the putclip and getclip utilities should be able to handle the job. I regularly use them with multiple megs worth of data and have never run into any trouble.

$ cat large.txt | putclip

$ getclip | wc -c

They come with the cygutils package...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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