If you use the terminal, and if you read this blog I think you will have done it sometime, you will have realized that it is not possible copy and paste with the keyboard shortcuts that we have been using all our lives. It was Apple who introduced the shortcut Ctrl + C to copy, I imagine that because "Copy" starts with C, and Ctrl + V to paste, whose explanation seems to be that it is next to C. These shortcuts do not work in the terminal of Linux. Why? There is a compelling reason.
Ctrl + C is used to interrupt an action in the Linux Bash. For example, although in this example it is not recommended, we can press Ctrl + C to interrupt an installation that is taking too long. Ctrl + V is used to insert the next character in the editor. If we press Ctrl + C or Ctrl + V in the terminal when we are not executing anything, what will appear will be ^ C and ^ V respectively. In short, the terminal uses the Ctrl key along with other characters to perform special functions in the bash, but modern terminals needed something else.
Modern terminal keyboard shortcuts
Modern developers thought that right-clicking and choosing the copy or paste option was too tedious, so they added new keyboard shortcuts. To the shortcuts that we can use in the rest of the applications to copy and paste we must add the «Shift» key. Here is a list of shortcuts to copy and paste different parts of the text:
|Ctrl + Shift + c||Copy the selected text.|
|Ctrl + Shift + v||Paste the copied text.|
|Ctrl + u||Cuts everything from the start of the line to the cursor.|
|Ctrl + k||Cut everything from the cursor to the end of the line.|
|Alt + d||Cut the word behind the cursor.|
|Ctrl + w||Cuts the word in front of the cursor.|
|Ctrl + y||Paste the previously cut text.|
|Alt + y||Paste the second previously cut text.|
|Alt + Ctrl + y||Paste the first argument of the previous command.|
I must admit that I am not a big fan of changes and having to add "Shift" to copy and paste in the terminal does not come naturally to me. But I'm also someone who likes efficiency, so knowing how to do it with the keyboard is useful to me. And you?