Copy and paste text in the Linux terminal is a simple task that can be done quickly and easily. There are several methods for doing this, including using the mouse, keyboard shortcuts, and command line tools.
This guide will walk you through each of these methods so that you can copy and paste text in the Linux terminal with ease. We’ll also discuss some tips and tricks for making your life easier when copying and pasting text in the Linux terminal.
1. Using keyboard shortcuts for copy pasting in Linux terminal
Ctrl + C is the typical keyboard shortcut for copying text. This is a universally recognised convention, and most of operating systems have this combination designated to text copying. With the exception of Linux!
Ctrl + Shift + C is the right keyboard shortcut for copying text in a Linux terminal, and Ctrl + Shift + X for cutting. Similarly, press Ctrl + Shift + V to paste a text line.
The underlying cause of this behavior can be traced back to Linux’s Unix roots. Ctrl + C was, and still is, the usual Unix shortcut for terminating a running programme prior to the advent of a system-wide clipboard. Ctrl + V was also used for a verbatim insert.
To preserve consistency, Ctrl + X was altered to include the Shift key when the new shortcuts were introduced for Unix and Linux.
2. Using the right-click context menu to copy and paste in the terminal
Using the right click context menu provides an additional method of copying and pasting into the terminal.
To copy text from the terminal, select the text by dragging the cursor over the desired text while holding down the left mouse button. When you right-click, the context menu appears. Cut, Copy, and Paste options,
Now all you have to do is right-click inside the terminal while you have the text selected and choose either Cut or Copy, depending on your needs. You can use this system-wide function to copy text from any location.
3. Change the Default Keyboard Shortcut
Nearly all Linux terminal emulators allow you to change the default keyboard shortcuts. Open the terminal, navigate to the Preferences section, and select Keyboard Shortcuts, Shortcuts, Keyboard, or a similar option to alter the shortcut for cut, copy, and paste.
Note: A majority of terminals provide an option to change the settings by right-click on any part of the window. This option is usually known as ‘Preferences’.
Copying, pasting, and cutting text can all be done quickly with specific key combinations. The combination for copy is Ctrl + C, for paste it’s Ctrl + V, and for cut it’s Ctrl + X. Memorizing these shortcuts make their use much more efficient.
To make sure the new shortcuts function properly, it is important to apply the changes and test them through copy-paste. There are general steps that will work with any terminal emulator; Console has the ‘Configure Shortcuts’ option, while Terminator allows you to access Preferences via the context menu.
Also Read: