Copying and pasting is one of the most used actions on a computer.
While it is easy to do so with the Ctrl + C and Ctrl + V keyboard shortcuts, on the Linux terminal it is not so straightforward.
You have several options to get the job done.
Sometimes while working in the Linux command line, you need to type the long commands or texts you found in the file or on the internet.
Instead of typing those commands or text, you can save time by copy-pasting them onto the command line Terminal application.
But you may wonder to know these usual keyboard shortcuts do not work in Linux Terminal.
In this context, we shall look into how to copy and paste text in the Linux Terminal.
How to use the Keyboard Shortcuts ?
Instead of Ctrl+c and Ctrl+v, the shortcuts to copy and paste in the Linux Terminal are Ctrl+Shift+c and Ctrl+Shift+v.
Let's say you want to copy the text or command from a document or webpage and paste it to the Terminal.
To copy the lines from a document or webpage that is open in the graphical application, select them, and press Ctrl+c.
To paste the copied lines into Terminal, press Ctrl+Shift+v.
After that, you will see the pasted lines on the Terminal.
Let's say you want to copy a line or command from the Nano editor and paste it to the Terminal. To copy it from the Nano editor, select it and press Ctrl+Shift+c.
To paste the copied lines to Nano editor or to shell outside Nano editor, press Ctrl+Shift+v. Now you will see the pasted lines on the Terminal.
How to use the Mouse Right-click ?
You can also copy-paste in Terminal using the mouse right-click as you normally do with other applications.
i. For instance, to copy any line from Terminal, select it and right-click it.
ii. Then pick Copy from the list of options that pop-up.
iii. Now the selected line will be copied.
iv. Now to paste the copied line in the Terminal, again right-click and select Paste.
v. Now you will see the pasted line on the Terminal.