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

后端 未结 6 1555
夕颜
夕颜 2021-01-30 05:27

I want to use part of the output of a command run from the command line in another xterm, or as part of a different command. For instance:

> grep error err         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 06:15

    You could also use tmux which has similar capabilities to screen. Once you're in tmux and you have the output you want to copy, you can do the following to copy and then paste it:

    1. Enter copy mode with Ctrl + B, [
    2. Move the cursor with the arrow keys and then start selection with Ctrl + Space
    3. Move the cursor to select the text/region to copy and then copy with Alt + W (this will immediately exit you from copy mode)
    4. You can now paste (within tmux only) using Ctrl + B, ]

    These instructiuons assume emacs key bindings are enabled. For the vi bindings see this comparison or just follow this step-by-step guide.

提交回复
热议问题