How to Copy Text from My Xterm Without a Mouse

How do I copy text from my xterm without a mouse?

You can use GNU screen's copy and paste commands.

Quick tutorial:

  1. Open screen: screen (or screen myprog my args here)
  2. Run your program, producing output you want copied
  3. Enter copy mode: Control+a+[
  4. Move your cursor to the start point
  5. Hit Enter
  6. Move your cursor to the end point
  7. Hit Enter
  8. Paste: Control+a+]

Screen is much more powerful than that (I use it to tab several virtual terminals without the need for a special terminal emulator, and also so that I don't loose my sessions when X crashes or something). To get out of screen, simply end your shell session, or type Ctrl+a, Ctrl+\.

Copy Paste Command in Text Based Linux Server (No GUI)

Note: This question is about a terminal, not a terminal emulator. A terminal is what you see when you connect a computer without a graphical desktop to a monitor and keyboard (no mouse supported at that point)

On a text based terminal (not a terminal emulator(!)) copy/paste is not possible.

If possible, I recommend to use ssh and connect with a terminal emulator which does support copy/paste to that box. For example gnome-terminal could be used for that: https://help.gnome.org/users/gnome-terminal/stable/txt-copy-paste.html

xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection

You might find Bug588785 interesting to read. A quick workaround would be to install and use xclipboard as seen in Comment 145.

Copy text from Vim 7.2 running in xterm to windows clipboard

Try

"+3yy
"*3yy

"+p
"*p


Related Topics



Leave a reply



Submit