Linux Applications

How to Copy from Clipboard to Nano

While you are using the nano editor and copying text, it is saved in a buffer called the Cutbuffer, and it is not the same as the clipboard because Gnome maintains the clipboard. You cannot paste anything from the nano editor to the other applications. Nano is a command line text editor that comes pre-installed in almost all Linux-based systems. It has a good set of features that make it above the others. But, how can you copy from the clipboard to the nano editor in Linux?

This article will go through how to copy the text from the Cutbuffer and clipboard (Gnome) to the nano editor.

How to Check if the Nano Editor is Installed

Nano editor is built in the Linux systems. But there are a few exceptions where you won’t find it in your system. So, to ensure if it is installed or not, use the following command in the terminal:

nano --version

It was installed in our case. But, if you cannot run the previously mentioned command mentioned, use the following command to install the nano editor on your system:

sudo apt install nano

Once you hit enter, it installs the nano editor for you.

How to Use the Nano Editor

The use of nano editor is simple, just like the other text editors. But you need to learn a few commands like the following:

nano newFile

*Creates a new file named “newFile”*

How to Save a File in Nano Editor

You need to use the following keys to save the file in the nano editor, asking you to name the file:

Ctrl+o

Text Description automatically generated

It saves the file once you press “enter”. But if you have made changes to the file name, it creates a new file without making any changes to the current file.

Copy Text from Cutbuffer to Nano Editor

You need to place the cursor to the start of the text that you want to mark or select. Then, use the following combination of keys:

CTRL+6

Alt+a

Or

And then, use your mouse or arrow keys to select or mark the text to be copied.

Once the required text to be copied is highlighted or marked, you can copy the text from the nano text editor to the Cutbuffer by combining the following keys:

Alt+6

You can also cut the whole line on which the cursor is on by pressing the following key:

Ctrl+k

Finally, the copied text can be pasted using the combination of these keys:

Ctrl+u

But there is a catch: you can only paste the copied text inside the current nano editor window. And once we close the editor, everything is lost.

Copying from Clipboard to Nano Editor

While using other text editors in Linux, you can copy the text by pressing “Ctrl+Shift+c”. The text that you copied will not be saved in the Cutbuffer, but it is saved in the Gnome clipboard.

But it can be pasted into the nano editor using the following key combination and it can be pasted anywhere inside the Linux system:

Ctrl+Shift+v

You can also right-click in the current nano editor window and select paste from it.

Conclusion

Nano editor is a terminal or command-based application that won’t let you copy anything inside it to the other applications. Still, you can copy and paste the text from the Gnome clipboard to the nano editor.

Nano editor is an easy-to-use application that is pre-installed in almost all Linux-based systems. Due to its simplicity and features, it certainly grabs a lot of attention from the editors.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.