I am interested in the technical part of the question, namely where the copied text is stored after pressing CTRL + U. In the environment variable? In a special device?

  • one
    They say no clipboard in bash. Use the one that is at hand. In the X shell, there are even 3 buffers. In the text console, your buffer. - Sergey
  • @Sergey I'm interested in the one in the text console. - Vampir
  • Which is not in the window? Yes, no one knows how it works. At best, gpm, selection, copying, pasting with the mouse is mentioned. And that is all. No one uses the text console. I remembered here. The command line uses readline, for sure it provides the clipboard. Then almost certainly everything is stored in memory. - Sergey
  • But there is a history of commands in the ~ / .history file like - Sergey
  • @Sergey looked in the readline source, really stored in memory. In the rl_kill_ring array. - Vampir

2 answers 2

In the memory of the very process bash in which this occurs. More precisely, this is not what bash does, but the readline library, and the contents of this buffer are part of its state.

    Which console? There are dozens of consoles in linux.

    I work in konsole in this console Ctrl + Shift + C copy. I use Clipman .

    The bash clipboard is in the inside of the program and access is possible only by pressing the keys, there is also a history of history commands

    • You are not right. cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC17 kill and yank are analogous to cut and paste. Moreover, there is not one buffer, but a ring. - Netch
    • @Netch The question was about bash and not the Readline library. But really, bash has a small buffer in emacs mode, you can delete a word or a line and insert Ctrl + Y and in the Vi mode, you can also delete a word or a line and insert in the command mode the 'p' key - Yaroslav
    • bash is very much tied up with readline, too difficult to separate, so this is the same thing. - Netch