0

I have a script that operates on enormous files and outputs an enormous amount of content (almost 7000 lines). I need to copy the output of this to my clipboard so I can then paste it into paste2.org and make a paste. Is there a way for me to directly copy the output to my clipboard? Some operation like that of redirection for the clipboard?

Rohan
  • 3,491
  • 9
  • 28
  • 45
  • 2
    @Gilles That question is the other way around, i.e. paste, not copy. This one is about copying: [How do I send stdin to the clipboard?](https://unix.stackexchange.com/questions/3892/how-do-i-send-stdin-to-the-clipboard). – Sparhawk Jan 16 '16 at 00:40

2 Answers2

2

You can use the tools xsel or xclip to translate from X clipboard to stdin/stdout on a terminal. If these aren't installed, they're usually available through your distro's package manager. See the man page for the relevant tool to get details on invocation.

Tom Hunt
  • 9,808
  • 4
  • 25
  • 43
1
  1. Use file redirection to save standard out to a temporary file such as /tmp/o

    $ script.sh > /tmp/o

  2. Open browser such as Firefox/Iceweasel, to address: /tmp/o

  3. Now select all, copy and paste to Pastebin.org

clarity123
  • 3,519
  • 1
  • 12
  • 16