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

Is there a way to select and copy text anywhere in terminal(xterm) window(that is, not only current shell line, but also output from previous commands) using only keyboard?

share|improve this question

tmux and screen (shell multiplexers) both have a copy-mode, which you can enter via keyboard, move around the cursor via keys .. and select text via the cursor. naturally, you can scroll back in the output buffer.

i don't know a pure xterm-solution, maybe something like gnome-terminal etc will do it (allthough i doubt it, they are even more fancy than xterm :))

share|improve this answer
I know and use tmux, though here I'm looking for terminal only solution. I would fall back to multiplexers only if there is no solution. – morphles Apr 19 '12 at 7:39

XTerm version from end of 2013 cannot do that, unfortunately.

You can use tmux or screen to copy text, as akira reponded.

Also you can copy output of the last command to X selection easily with:

!! | xsel -bi

More here:

share|improve this answer
Splendid! You got a +1 just for posting that link, because all this stuff here is pretty useless for me. However, Q312213 had exactly what I was looking for - thanks! – syntaxerror Dec 8 '14 at 22:21

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.