Copying, cutting, and pasting are the most basic tasks in text editing but if you are new to the nano, you may find it complex to perform those basic tasks.
To make things easy to understand, I have divided this guide into 3 parts:
- Copy text in the nano text editor
- Cut text in the nano text editor
- Paste text in the nano text editor
So let's start with the first one.
How to copy text in the nano text editor
There are two ways you can copy text in the nano text editor:
- Using mouse (easy)
- Using keyboard
I would recommend going with the first method if you are a beginner and don't want to overwhelm yourself with shortcuts.
Use the mouse to copy the text in the nano text editor
To copy text using the mouse, all you have to do is follow two simple steps:
- Select text using the mouse
- Right-click and select the
Sounds complex? Let me show you how you pull that off:
Use keyboard to copy text in the nano text editor
While using the mouse looks super convenient way to copy text, it won't let you select anything outside of what is being shown on the terminal screen.
There comes the magic of using keyboard shortcuts that let you do things that your mouse won't.
To use this method, you have to follow 3 simple steps:
- First, go to the point from where you can start the selection of text and press
Ctrl + 6to set the mark.
- Now, use the arrow keys (or even Home, End, Page Up, and Page Down keys for faster selection) to select the text. The selection will be highlighted.
- Once done, press
Alt + 6to copy the selected area.
Here is how you perform those 3 steps to copy text:
How to cut text in the nano text editor
Unlike the copy operation, you can not use the mouse to cut text so you are only left with the keyboard method.
Don't worry, it is very similar to copying text using the keyboard and can be done in 3 easy steps:
- Navigate to the point from where you want to start selecting text and press
Ctrl + 6to set the mark.
- Now, use the arrow keys to select lines.
Ctrl + Kto cut the selected text.
Sounds difficult? Here's how to cut text using the above steps:
How to paste text in the nano text editor
Once you are done copying or cutting text, you can paste it using the
Ctrl + U shortcut.
Want detailed steps to do so? Just follow these 2:
- Navigate to the point where you want to paste the text.
Ctrl + Uto paste the text.
In the below example, I copied text and then pasted it for your reference:
Get more out of the nano text editor
If you are just getting started with the Nano text editor or want to learn more about its features, you can refer to our detailed guide on using Nano:
Here's a detailed guide on how you edit files in the nano text editor:
I hope you will find this guide helpful.