This article shows you how to copy text from the Nano editor to the shell through the following two methods:
- Method 1: Using key combinations
- Method 2: Using the right-click menu
Both methods copy the text to the GNOME clipboard instead of copying the text to the Nano cut buffer. Using either of these methods, you can copy the text anywhere outside of the Nano editor.
We have tested the procedure in the Ubuntu 20.04 LTS Terminal. The same procedure can be followed in any other Linux distribution that has the Nano editor installed.
Method 1: Using Key Combinations
To copy text from the Nano editor and paste it to the shell, follow the steps listed below:
First, mark (select) the text in the Nano editor. Place the cursor at the start of the text and press Ctr+6. Then, use the right or left arrow key to mark the required text.
To copy the marked text, use the Ctrl+Shift+C shortcut.
To paste the copied text to the shell, use Ctrl+Shift+V.
Method 2: Using the Right-Click Menu
To copy text from the Nano editor and paste it to the shell, follow the steps listed below:
First, mark the text in the Nano editor by holding the left mouse button and dragging it to the right or left to select the text.
To copy the marked text, right-click the text and select Copy from the menu.
To paste the copied text to the shell, again, right-click the text and select Paste from the menu.