14

I am able to copy a massive string of text but unable to paste it anywhere without the program crashing.

So, I wonder: How can I fetch it from the clipboard via CLI and save it to a file instead?

Thanks!

Nathan J.B.
  • 2,730

2 Answers2

18

xclip is the command line interface to X selections (clipboard)

xclip -o > helloworld.c

You may need to modify the command depending on the selection you're using

   -selection
          specify  which  X  selection  to use, options are "primary" to use XA_PRIMARY (default), "secondary" for XA_SECONDARY or
          "clipboard" for XA_CLIPBOARD
Sergey
  • 44,353
1

I created a file browser extension for that :) +info.

Best regards.

Costales
  • 2,318