Selecting text in the terminal without using the mouse The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to copy or select current string in terminal?How does Middle Click paste work?Copying a long command from history in terminalHow to efficiently send text entered on the command line to the system clipboard without using the mouse?Why can't I copy text from the Ubuntu Terminal?How to copy an entire command line to my clipboard, without the mouse?How to select text for copy and paste in Chrome by keyboard not using the mouse?Terminal - Selecting commands I've entered using the keyboardSelect/copy/paste in terminal using only the keyboardHow can I copy text from xfce4 terminal emulator to the clipboard?text highlighting (select to copy) stopped working in the terminalHow to copy terminal command in clipboard without using mouse?Add custom shortcut to the GNOME Terminal

How to determine omitted units in a publication

different output for groups and groups USERNAME after adding a username to a group

Was credit for the black hole image misappropriated?

What happens to a Warlock's expended Spell Slots when they gain a Level?

What do I do when my TA workload is more than expected?

Identify 80s or 90s comics with ripped creatures (not dwarves)

Do ℕ, mathbbN, BbbN, symbbN effectively differ, and is there a "canonical" specification of the naturals?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

Could an empire control the whole planet with today's comunication methods?

Using dividends to reduce short term capital gains?

Can withdrawing asylum be illegal?

60's-70's movie: home appliances revolting against the owners

Why doesn't a hydraulic lever violate conservation of energy?

"... to apply for a visa" or "... and applied for a visa"?

How do spell lists change if the party levels up without taking a long rest?

Is there a writing software that you can sort scenes like slides in PowerPoint?

What aspect of planet Earth must be changed to prevent the industrial revolution?

Can each chord in a progression create its own key?

What is the padding with red substance inside of steak packaging?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

Huge performance difference of the command find with and without using %M option to show permissions

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Are there continuous functions who are the same in an interval but differ in at least one other point?



Selecting text in the terminal without using the mouse



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to copy or select current string in terminal?How does Middle Click paste work?Copying a long command from history in terminalHow to efficiently send text entered on the command line to the system clipboard without using the mouse?Why can't I copy text from the Ubuntu Terminal?How to copy an entire command line to my clipboard, without the mouse?How to select text for copy and paste in Chrome by keyboard not using the mouse?Terminal - Selecting commands I've entered using the keyboardSelect/copy/paste in terminal using only the keyboardHow can I copy text from xfce4 terminal emulator to the clipboard?text highlighting (select to copy) stopped working in the terminalHow to copy terminal command in clipboard without using mouse?Add custom shortcut to the GNOME Terminal



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








58















I am about to press enter to run a command in terminal, but before doing that, I want to copy the command to clipboard without using the mouse.



How?



If you're somewhere other than the terminal, Ctrl+Home does it.



Is there a way of arbitrarily selecting text like that in the terminal?



EDITED:



  • assume that using other programs like screen is not a good alternative

  • the text is to be pasted outside the terminal, so Ctrl+y and similar sequences do not solve it either









share|improve this question



















  • 1





    You mean Ctrl-Shift-Home?

    – Mechanical snail
    May 31 '13 at 6:14












  • Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

    – Strapakowsky
    May 31 '13 at 6:19











  • Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

    – Brambor
    Nov 4 '18 at 1:47


















58















I am about to press enter to run a command in terminal, but before doing that, I want to copy the command to clipboard without using the mouse.



How?



If you're somewhere other than the terminal, Ctrl+Home does it.



Is there a way of arbitrarily selecting text like that in the terminal?



EDITED:



  • assume that using other programs like screen is not a good alternative

  • the text is to be pasted outside the terminal, so Ctrl+y and similar sequences do not solve it either









share|improve this question



















  • 1





    You mean Ctrl-Shift-Home?

    – Mechanical snail
    May 31 '13 at 6:14












  • Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

    – Strapakowsky
    May 31 '13 at 6:19











  • Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

    – Brambor
    Nov 4 '18 at 1:47














58












58








58


16






I am about to press enter to run a command in terminal, but before doing that, I want to copy the command to clipboard without using the mouse.



How?



If you're somewhere other than the terminal, Ctrl+Home does it.



Is there a way of arbitrarily selecting text like that in the terminal?



EDITED:



  • assume that using other programs like screen is not a good alternative

  • the text is to be pasted outside the terminal, so Ctrl+y and similar sequences do not solve it either









share|improve this question
















I am about to press enter to run a command in terminal, but before doing that, I want to copy the command to clipboard without using the mouse.



How?



If you're somewhere other than the terminal, Ctrl+Home does it.



Is there a way of arbitrarily selecting text like that in the terminal?



EDITED:



  • assume that using other programs like screen is not a good alternative

  • the text is to be pasted outside the terminal, so Ctrl+y and similar sequences do not solve it either






command-line shortcut-keys






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 31 '13 at 5:09







Strapakowsky

















asked May 31 '13 at 2:50









StrapakowskyStrapakowsky

3,874112638




3,874112638







  • 1





    You mean Ctrl-Shift-Home?

    – Mechanical snail
    May 31 '13 at 6:14












  • Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

    – Strapakowsky
    May 31 '13 at 6:19











  • Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

    – Brambor
    Nov 4 '18 at 1:47













  • 1





    You mean Ctrl-Shift-Home?

    – Mechanical snail
    May 31 '13 at 6:14












  • Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

    – Strapakowsky
    May 31 '13 at 6:19











  • Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

    – Brambor
    Nov 4 '18 at 1:47








1




1





You mean Ctrl-Shift-Home?

– Mechanical snail
May 31 '13 at 6:14






You mean Ctrl-Shift-Home?

– Mechanical snail
May 31 '13 at 6:14














Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

– Strapakowsky
May 31 '13 at 6:19





Shift-Home copies to the beginning of the line. Ctrl-Shift-Home copies to the beginning of the page.

– Strapakowsky
May 31 '13 at 6:19













Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

– Brambor
Nov 4 '18 at 1:47






Shift-Home and Ctrl-Shift-Home do the same for me (jump to beggining of terminal) and neither of them seem to copy anything to be pased by neither Ctrl-Y or Ctrl-Shift-V (nor select). But it does work in text editor, not copying, just selecting. Using OpenSUSE Leap 15 in Virtual Box. Every other key-binding mentioned in answers works.

– Brambor
Nov 4 '18 at 1:47











6 Answers
6






active

oldest

votes


















14














Bind following shortcut:



bind '"C-p": "C-eC-u xsel <<"EOF"nC-ynEOFnC-y"'


Now after using Crtl+P your line will be copied into clipboard. You can paste it in terminal using:



xsel


And into any X application using middle mouse button or Shift+Insert.






share|improve this answer

























  • i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

    – MrGigu
    Aug 19 '16 at 9:24











  • @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

    – Nykakin
    Aug 19 '16 at 9:59












  • Oh thanks, shift+insert works will do! didnt know you could paste with this command.

    – MrGigu
    Aug 23 '16 at 14:29











  • Any explanation as to what's actually going on here?

    – Alexander
    Mar 22 '18 at 17:06











  • Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

    – wjandrea
    Aug 24 '18 at 18:49



















24














If you are using one of the shells that understands emacs keys (bash, csh, etc.) then you can copy the current command by:



  1. control-A will take you to the beginning of the line.


  2. control-K will kill the whole line that you have just entered.


  3. control-Y will yank the text back.


Then later you can control-Y yank the text back to insert the text back as input to the shell command line editor.



See man bash and then when it comes up, type /emacs followed by a couple of n's (next) to move you forward to the READLINE section.






share|improve this answer























  • I knew that but want to paste outside the terminal. Edited for clarification.

    – Strapakowsky
    May 31 '13 at 5:09






  • 2





    control-U can cut the command from the end of it directly

    – vstepaniuk
    Feb 14 '18 at 18:47


















8














The closest I can think of is Ctrl+u, Ctrl+y

This would delete from cursor to the beginning of line, then paste from the readline buffer.
This isn't exactly the same as the clipboard though, but you would be able to paste inside the shell, if that is what you need.






share|improve this answer

























  • I knew that but want to paste outside the terminal. Edited for clarification.

    – Strapakowsky
    May 31 '13 at 5:10


















6














There is a program called screen. It creates a text windowing system that allows you to switch between multiple instances. But it also allows you to select text.



sudo apt-get install screen


That command installs it.



Then type screen



You use ctr-a to start the command sequence. Then press esc and your cursor will move in any direction. Press enter to start text selection, move to end point, press enter again. That will copy to buffer.



Then ctr-a and then } will paste



More details about other commands here http://www.kuro5hin.org/story/2004/3/9/16838/14935






share|improve this answer

























  • Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

    – Strapakowsky
    May 31 '13 at 5:11






  • 1





    This should be marked as the correct answer IMHO.

    – eddiewould
    Jan 19 '16 at 7:15


















1














If you are inside vim you can visually select one or more lines with Shift+v and then use a binding, e.g. yy, to pipe the selection to xclip.



Add the binding to your vimrc:



vnoremap yy :w !xclip -selection clipboard<CR><CR>


This requires xclip to be installed, it is in the Debian/Ubuntu aptitude repository.



xclip stores stdin, with the -selection clipboard option it also pushes stdin to the system clipboard.



So you can also use xclip in a generic way from the terminal, for example to copy an entire file to the system clipboard:



cat myfile | xclip -selection clipboard


If you can optionally also create an alias, such as:



alias cb="xclip -selection clipboard" 





share|improve this answer
































    0














    Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.



    Copied from https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse/29386401






    share|improve this answer








    New contributor




    Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "89"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f302263%2fselecting-text-in-the-terminal-without-using-the-mouse%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      14














      Bind following shortcut:



      bind '"C-p": "C-eC-u xsel <<"EOF"nC-ynEOFnC-y"'


      Now after using Crtl+P your line will be copied into clipboard. You can paste it in terminal using:



      xsel


      And into any X application using middle mouse button or Shift+Insert.






      share|improve this answer

























      • i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

        – MrGigu
        Aug 19 '16 at 9:24











      • @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

        – Nykakin
        Aug 19 '16 at 9:59












      • Oh thanks, shift+insert works will do! didnt know you could paste with this command.

        – MrGigu
        Aug 23 '16 at 14:29











      • Any explanation as to what's actually going on here?

        – Alexander
        Mar 22 '18 at 17:06











      • Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

        – wjandrea
        Aug 24 '18 at 18:49
















      14














      Bind following shortcut:



      bind '"C-p": "C-eC-u xsel <<"EOF"nC-ynEOFnC-y"'


      Now after using Crtl+P your line will be copied into clipboard. You can paste it in terminal using:



      xsel


      And into any X application using middle mouse button or Shift+Insert.






      share|improve this answer

























      • i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

        – MrGigu
        Aug 19 '16 at 9:24











      • @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

        – Nykakin
        Aug 19 '16 at 9:59












      • Oh thanks, shift+insert works will do! didnt know you could paste with this command.

        – MrGigu
        Aug 23 '16 at 14:29











      • Any explanation as to what's actually going on here?

        – Alexander
        Mar 22 '18 at 17:06











      • Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

        – wjandrea
        Aug 24 '18 at 18:49














      14












      14








      14







      Bind following shortcut:



      bind '"C-p": "C-eC-u xsel <<"EOF"nC-ynEOFnC-y"'


      Now after using Crtl+P your line will be copied into clipboard. You can paste it in terminal using:



      xsel


      And into any X application using middle mouse button or Shift+Insert.






      share|improve this answer















      Bind following shortcut:



      bind '"C-p": "C-eC-u xsel <<"EOF"nC-ynEOFnC-y"'


      Now after using Crtl+P your line will be copied into clipboard. You can paste it in terminal using:



      xsel


      And into any X application using middle mouse button or Shift+Insert.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 24 '18 at 18:31









      wjandrea

      9,57042765




      9,57042765










      answered May 31 '13 at 6:28









      NykakinNykakin

      3,0151217




      3,0151217












      • i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

        – MrGigu
        Aug 19 '16 at 9:24











      • @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

        – Nykakin
        Aug 19 '16 at 9:59












      • Oh thanks, shift+insert works will do! didnt know you could paste with this command.

        – MrGigu
        Aug 23 '16 at 14:29











      • Any explanation as to what's actually going on here?

        – Alexander
        Mar 22 '18 at 17:06











      • Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

        – wjandrea
        Aug 24 '18 at 18:49


















      • i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

        – MrGigu
        Aug 19 '16 at 9:24











      • @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

        – Nykakin
        Aug 19 '16 at 9:59












      • Oh thanks, shift+insert works will do! didnt know you could paste with this command.

        – MrGigu
        Aug 23 '16 at 14:29











      • Any explanation as to what's actually going on here?

        – Alexander
        Mar 22 '18 at 17:06











      • Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

        – wjandrea
        Aug 24 '18 at 18:49

















      i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

      – MrGigu
      Aug 19 '16 at 9:24





      i want to avoid using the mouse. Is it possible to paste it with ctrl+shift+v instead of middle mouse button?

      – MrGigu
      Aug 19 '16 at 9:24













      @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

      – Nykakin
      Aug 19 '16 at 9:59






      @MrGigu, this uses a different clipboard (see here). You need to use other shortcut. By default it should be Shift+Insert (see here)

      – Nykakin
      Aug 19 '16 at 9:59














      Oh thanks, shift+insert works will do! didnt know you could paste with this command.

      – MrGigu
      Aug 23 '16 at 14:29





      Oh thanks, shift+insert works will do! didnt know you could paste with this command.

      – MrGigu
      Aug 23 '16 at 14:29













      Any explanation as to what's actually going on here?

      – Alexander
      Mar 22 '18 at 17:06





      Any explanation as to what's actually going on here?

      – Alexander
      Mar 22 '18 at 17:06













      Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

      – wjandrea
      Aug 24 '18 at 18:49






      Or use xsel -b to use the standard clipboard, i.e the one that uses Ctrl+V/Ctrl+Shift+V. Also worth noting that this method fails on multi-line commands.

      – wjandrea
      Aug 24 '18 at 18:49














      24














      If you are using one of the shells that understands emacs keys (bash, csh, etc.) then you can copy the current command by:



      1. control-A will take you to the beginning of the line.


      2. control-K will kill the whole line that you have just entered.


      3. control-Y will yank the text back.


      Then later you can control-Y yank the text back to insert the text back as input to the shell command line editor.



      See man bash and then when it comes up, type /emacs followed by a couple of n's (next) to move you forward to the READLINE section.






      share|improve this answer























      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:09






      • 2





        control-U can cut the command from the end of it directly

        – vstepaniuk
        Feb 14 '18 at 18:47















      24














      If you are using one of the shells that understands emacs keys (bash, csh, etc.) then you can copy the current command by:



      1. control-A will take you to the beginning of the line.


      2. control-K will kill the whole line that you have just entered.


      3. control-Y will yank the text back.


      Then later you can control-Y yank the text back to insert the text back as input to the shell command line editor.



      See man bash and then when it comes up, type /emacs followed by a couple of n's (next) to move you forward to the READLINE section.






      share|improve this answer























      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:09






      • 2





        control-U can cut the command from the end of it directly

        – vstepaniuk
        Feb 14 '18 at 18:47













      24












      24








      24







      If you are using one of the shells that understands emacs keys (bash, csh, etc.) then you can copy the current command by:



      1. control-A will take you to the beginning of the line.


      2. control-K will kill the whole line that you have just entered.


      3. control-Y will yank the text back.


      Then later you can control-Y yank the text back to insert the text back as input to the shell command line editor.



      See man bash and then when it comes up, type /emacs followed by a couple of n's (next) to move you forward to the READLINE section.






      share|improve this answer













      If you are using one of the shells that understands emacs keys (bash, csh, etc.) then you can copy the current command by:



      1. control-A will take you to the beginning of the line.


      2. control-K will kill the whole line that you have just entered.


      3. control-Y will yank the text back.


      Then later you can control-Y yank the text back to insert the text back as input to the shell command line editor.



      See man bash and then when it comes up, type /emacs followed by a couple of n's (next) to move you forward to the READLINE section.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 31 '13 at 4:25









      ElderDelpElderDelp

      42625




      42625












      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:09






      • 2





        control-U can cut the command from the end of it directly

        – vstepaniuk
        Feb 14 '18 at 18:47

















      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:09






      • 2





        control-U can cut the command from the end of it directly

        – vstepaniuk
        Feb 14 '18 at 18:47
















      I knew that but want to paste outside the terminal. Edited for clarification.

      – Strapakowsky
      May 31 '13 at 5:09





      I knew that but want to paste outside the terminal. Edited for clarification.

      – Strapakowsky
      May 31 '13 at 5:09




      2




      2





      control-U can cut the command from the end of it directly

      – vstepaniuk
      Feb 14 '18 at 18:47





      control-U can cut the command from the end of it directly

      – vstepaniuk
      Feb 14 '18 at 18:47











      8














      The closest I can think of is Ctrl+u, Ctrl+y

      This would delete from cursor to the beginning of line, then paste from the readline buffer.
      This isn't exactly the same as the clipboard though, but you would be able to paste inside the shell, if that is what you need.






      share|improve this answer

























      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:10















      8














      The closest I can think of is Ctrl+u, Ctrl+y

      This would delete from cursor to the beginning of line, then paste from the readline buffer.
      This isn't exactly the same as the clipboard though, but you would be able to paste inside the shell, if that is what you need.






      share|improve this answer

























      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:10













      8












      8








      8







      The closest I can think of is Ctrl+u, Ctrl+y

      This would delete from cursor to the beginning of line, then paste from the readline buffer.
      This isn't exactly the same as the clipboard though, but you would be able to paste inside the shell, if that is what you need.






      share|improve this answer















      The closest I can think of is Ctrl+u, Ctrl+y

      This would delete from cursor to the beginning of line, then paste from the readline buffer.
      This isn't exactly the same as the clipboard though, but you would be able to paste inside the shell, if that is what you need.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 24 '18 at 18:28









      Carolus

      183113




      183113










      answered May 31 '13 at 3:03









      demuredemure

      1,8251816




      1,8251816












      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:10

















      • I knew that but want to paste outside the terminal. Edited for clarification.

        – Strapakowsky
        May 31 '13 at 5:10
















      I knew that but want to paste outside the terminal. Edited for clarification.

      – Strapakowsky
      May 31 '13 at 5:10





      I knew that but want to paste outside the terminal. Edited for clarification.

      – Strapakowsky
      May 31 '13 at 5:10











      6














      There is a program called screen. It creates a text windowing system that allows you to switch between multiple instances. But it also allows you to select text.



      sudo apt-get install screen


      That command installs it.



      Then type screen



      You use ctr-a to start the command sequence. Then press esc and your cursor will move in any direction. Press enter to start text selection, move to end point, press enter again. That will copy to buffer.



      Then ctr-a and then } will paste



      More details about other commands here http://www.kuro5hin.org/story/2004/3/9/16838/14935






      share|improve this answer

























      • Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

        – Strapakowsky
        May 31 '13 at 5:11






      • 1





        This should be marked as the correct answer IMHO.

        – eddiewould
        Jan 19 '16 at 7:15















      6














      There is a program called screen. It creates a text windowing system that allows you to switch between multiple instances. But it also allows you to select text.



      sudo apt-get install screen


      That command installs it.



      Then type screen



      You use ctr-a to start the command sequence. Then press esc and your cursor will move in any direction. Press enter to start text selection, move to end point, press enter again. That will copy to buffer.



      Then ctr-a and then } will paste



      More details about other commands here http://www.kuro5hin.org/story/2004/3/9/16838/14935






      share|improve this answer

























      • Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

        – Strapakowsky
        May 31 '13 at 5:11






      • 1





        This should be marked as the correct answer IMHO.

        – eddiewould
        Jan 19 '16 at 7:15













      6












      6








      6







      There is a program called screen. It creates a text windowing system that allows you to switch between multiple instances. But it also allows you to select text.



      sudo apt-get install screen


      That command installs it.



      Then type screen



      You use ctr-a to start the command sequence. Then press esc and your cursor will move in any direction. Press enter to start text selection, move to end point, press enter again. That will copy to buffer.



      Then ctr-a and then } will paste



      More details about other commands here http://www.kuro5hin.org/story/2004/3/9/16838/14935






      share|improve this answer















      There is a program called screen. It creates a text windowing system that allows you to switch between multiple instances. But it also allows you to select text.



      sudo apt-get install screen


      That command installs it.



      Then type screen



      You use ctr-a to start the command sequence. Then press esc and your cursor will move in any direction. Press enter to start text selection, move to end point, press enter again. That will copy to buffer.



      Then ctr-a and then } will paste



      More details about other commands here http://www.kuro5hin.org/story/2004/3/9/16838/14935







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited May 31 '13 at 3:25

























      answered May 31 '13 at 3:00









      Meer BorgMeer Borg

      3,75462550




      3,75462550












      • Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

        – Strapakowsky
        May 31 '13 at 5:11






      • 1





        This should be marked as the correct answer IMHO.

        – eddiewould
        Jan 19 '16 at 7:15

















      • Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

        – Strapakowsky
        May 31 '13 at 5:11






      • 1





        This should be marked as the correct answer IMHO.

        – eddiewould
        Jan 19 '16 at 7:15
















      Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

      – Strapakowsky
      May 31 '13 at 5:11





      Good suggestion, but I don't like screen for different reasons, so assume regular Ubuntu terminal. Edited my question for clarification.

      – Strapakowsky
      May 31 '13 at 5:11




      1




      1





      This should be marked as the correct answer IMHO.

      – eddiewould
      Jan 19 '16 at 7:15





      This should be marked as the correct answer IMHO.

      – eddiewould
      Jan 19 '16 at 7:15











      1














      If you are inside vim you can visually select one or more lines with Shift+v and then use a binding, e.g. yy, to pipe the selection to xclip.



      Add the binding to your vimrc:



      vnoremap yy :w !xclip -selection clipboard<CR><CR>


      This requires xclip to be installed, it is in the Debian/Ubuntu aptitude repository.



      xclip stores stdin, with the -selection clipboard option it also pushes stdin to the system clipboard.



      So you can also use xclip in a generic way from the terminal, for example to copy an entire file to the system clipboard:



      cat myfile | xclip -selection clipboard


      If you can optionally also create an alias, such as:



      alias cb="xclip -selection clipboard" 





      share|improve this answer





























        1














        If you are inside vim you can visually select one or more lines with Shift+v and then use a binding, e.g. yy, to pipe the selection to xclip.



        Add the binding to your vimrc:



        vnoremap yy :w !xclip -selection clipboard<CR><CR>


        This requires xclip to be installed, it is in the Debian/Ubuntu aptitude repository.



        xclip stores stdin, with the -selection clipboard option it also pushes stdin to the system clipboard.



        So you can also use xclip in a generic way from the terminal, for example to copy an entire file to the system clipboard:



        cat myfile | xclip -selection clipboard


        If you can optionally also create an alias, such as:



        alias cb="xclip -selection clipboard" 





        share|improve this answer



























          1












          1








          1







          If you are inside vim you can visually select one or more lines with Shift+v and then use a binding, e.g. yy, to pipe the selection to xclip.



          Add the binding to your vimrc:



          vnoremap yy :w !xclip -selection clipboard<CR><CR>


          This requires xclip to be installed, it is in the Debian/Ubuntu aptitude repository.



          xclip stores stdin, with the -selection clipboard option it also pushes stdin to the system clipboard.



          So you can also use xclip in a generic way from the terminal, for example to copy an entire file to the system clipboard:



          cat myfile | xclip -selection clipboard


          If you can optionally also create an alias, such as:



          alias cb="xclip -selection clipboard" 





          share|improve this answer















          If you are inside vim you can visually select one or more lines with Shift+v and then use a binding, e.g. yy, to pipe the selection to xclip.



          Add the binding to your vimrc:



          vnoremap yy :w !xclip -selection clipboard<CR><CR>


          This requires xclip to be installed, it is in the Debian/Ubuntu aptitude repository.



          xclip stores stdin, with the -selection clipboard option it also pushes stdin to the system clipboard.



          So you can also use xclip in a generic way from the terminal, for example to copy an entire file to the system clipboard:



          cat myfile | xclip -selection clipboard


          If you can optionally also create an alias, such as:



          alias cb="xclip -selection clipboard" 






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 16 '16 at 8:45

























          answered Aug 16 '16 at 8:21









          KrisKris

          1115




          1115





















              0














              Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.



              Copied from https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse/29386401






              share|improve this answer








              New contributor




              Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                0














                Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.



                Copied from https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse/29386401






                share|improve this answer








                New contributor




                Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  0












                  0








                  0







                  Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.



                  Copied from https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse/29386401






                  share|improve this answer








                  New contributor




                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.



                  Copied from https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse/29386401







                  share|improve this answer








                  New contributor




                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 2 days ago









                  JakobovskiJakobovski

                  1011




                  1011




                  New contributor




                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Jakobovski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f302263%2fselecting-text-in-the-terminal-without-using-the-mouse%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Tamil (spriik) Luke uk diar | Nawigatjuun

                      Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                      Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?