The cut, copy, and paste file editing operations are key in the mastery of Linux file management. On a graphical text editor like LibreOffice Writer, the implementation of these file editing operations are a no-brainer.
However, the nano text editor offers some file editing flexibility not evident in graphical file editors like LibreOffice Writer. For instance, it is easier to navigate to various file paths and open them via the nano editor than it is to achieve the same objective using a graphical text editor.
This tutorial will show us how easy it is to achieve cut, copy, and paste text operations while using the nano text editor in Linux.
Problem Statement
For this tutorial to be interactive and well understood, we need a reference file for demonstrating the cut, copy, and paste operations we will be addressing through the nano editor.
Consider the following sample file:
![Nano Sample File in Linux](https://www.ubuntumint.com/wp-content/uploads/2022/07/Nano-Sample-File-in-Linux.png)
Cut and Paste Text in Nano Editor
The implementation of the cut text operation can be interpreted in the following manner. The cut text operation deletes the highlighted line entry from the currently open file.
For instance, in the above open file, we can cut the line entry “I am a file called new_file.txt!” in the following manner.
The first step is to position the cursor on the line entry you wish to cut using the keyboard arrow key.
![Position Cursor in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Position-Cursor-in-Nano-Editor.png)
From here, use the keyboard key combination [Ctrl]+6
to mark the text selection starting point.
![Mark Text Selection in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Mark-Text-Selection-in-Nano-Editor.png)
Now use the keyboard arrow keys to highlight the text you wish to cut.
![Highlight Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Highlight-Text-in-Nano-Editor.png)
To cut our text, we will use the keyboard key combination [Ctrl]+k
.
![Cut Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Cut-Text-in-Nano-Editor.png)
To paste our cut text, navigate to the file entry position where you would like to paste the cut text. It could be the same file or on another file opened by the nano editor.
Once you are at the right pasting position, use the keyboard key combination [Ctrl]+u
to paste the cut text content.
![Paste Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Paste-Text-in-Nano-Editor.png)
Copy and Paste Text in Nano Editor
Text copying operation only duplicates a highlighted line entry on a text file. To copy the text “I am a file called new_file.txt!” we will follow the following steps.
Position the cursor on the line entry you wish to copy using the keyboard arrow key.
![Position Cursor Line in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Position-Cursor-Line-Nano-Editor.png)
Use the keyboard key combination [Ctrl]+6
to mark the text selection starting point.
![Mark Text Selection in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Mark-Text-Selection-Nano-Editor.png)
Use the keyboard arrow keys to highlight the text you wish to copy.
![Highlight Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Highlight-Text-Nano-Editor.png)
To copy our text, we will use the keyboard key combination [Alt]+6
.
![Copy Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Copy-Text-in-Nano-Editor.png)
To paste the copied text, navigate to the preferred file position and implement the keyboard key combination [Ctrl]+u
.
![Copy and Paste Text in Nano Editor](https://www.ubuntumint.com/wp-content/uploads/2022/07/Copy-Paste-Text-in-Nano-Editor.png)
Once you are through with cutting or pasting your text, you can save (Ctrl+o)
and exit (Ctrl+x)
your file.
In our next article guide, we will address how to search and replace text in nano editor.