Pasting Clipboard Contents into Terminal [duplicate]

Possible Duplicate:
Can not paste into terminal

How can I paste clipboard contents into terminal without having to right click then press the "Paste" menu item? Ctrl-V doesn't work here!


Middle-click, Shift+Ins, or Shift+Ctrl+V.


You may want to try out xclip tool.

You can learn more about it by reading its man page or this blog post. I am using cp2clip and clippaste scripts that are explained there.


The X Windows system uses 2 clipboards...

The middle-click "clipboard" is entirely independant of the "Cntrl+Shift+C/V" clipboard..

The middle-click one uses what is called the "primary selection"..

The Cntrl+Shift+C/V one, uses what is called teh "clipbard selection"...
... It is just the "normal" Cntrl+C/V in (most?) other applications...

Thc "primary" (old terminology, I suppose) acts only on the most recently selected (and it must be currently selected) text, whereas the "clipboard selection" is actually stored in a seperate buffer (called the clipboard buffer) ...

Some programs don't handle these buffers properly, but moves are afoot to fix this.
eg... When you close Firefox, you will lose any "clipobard" text which was copied from Firefox... so if your clipboard text goes missing, this is the most likely reason...

This dual clipboard is not limited to the terminal. You can center-click in another application and it will paste the currently selected text from the most recently selected text (and that may be in another window)


If you have highlighted the commands you want to paste you van just middle click on the terminal. Usually the scroll wheel works as a middle button, or as on most notebooks you can click both buttons at once.