I have a newly installed Ubuntu 17.04 Server and am trying to install some packages that require long command lines.

I want to copy the long command line from the web page and paste it into the terminal window. However, NONE of the standard key or mouse combinations will work, i.e. ctrl+shift+v, shift+insert, ctrl+insert, middle click. Nothing works.

How can I paste external text into XTerm or UXTerm?

  • are you using a VM ?
    – luv.preet
    Aug 9, 2017 at 21:35

2 Answers 2


Pasting external text into a terminal window the Linux way

The Linux way works with xterm and uxterm, where there are no drop-down menus or Windows style control codes like ctrl + shift + v.

  1. Mark the text in the web page by pressing the left button of the mouse and move the mouse.

  2. After that move the mouse so that the cursor is in the terminal window.

  3. Press the middle button or the scroll wheel (press the scroll wheel as if it were a middle button). If there is no middle button you can press both the left and right buttons at the same time.


From the very helpful XTerm introduction and TrueType fonts configuration (futurile.net):

  1. Put configuration into ~/.Xresources
  2. Merge in changes to a running X session with: $ xrdb -merge ~/.Xresources


To tell xterm to use the standard Ctrl+Shift+c and Ctrl+Shift+v in the same way as gnome-terminal you add:

xterm*VT100.Translations: #override \ Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\ Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\ Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)

This line works for uxterm; simply duplicate it and insert a u at the beginning.

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.