List of content you will read in this article:
Nano is the most fundamental, command-line-based text editor for Linux. It has all common text editor features, including highlighting syntaxes, multiple buffers, scanning and replacing with regular expression support, type corrections, and UTF-8 encoding. So if you want to know more about nano commands, read this guide from start to end. We have collected and explained a complete list of nano shortcuts available.
How to Install Nano Text Editor
In most Linux distributions, nano is normally supported by default, but if it is not, use the next commands to install it.
- In the Debian/Ubuntu system:
$sudo apt install nano
- In the CentOS/Fedora system:
$yum install nano
Nano Important Shortcut Keys
Here is the list of all nano shortcuts available in Linux
Command |
Action |
Ctrl + O |
Save A File |
Alt + B |
Create a Backup |
Ctrl + X |
Exit file, with prompt |
Alt + U |
Undo an action |
Ctrl + G |
Get Help |
Ctrl + F |
Single character forward shift |
Ctrl + B |
Single character backward shift |
Ctrl + Space |
Move one word forward |
Alt + Space |
Move one work backward |
Ctrl + P |
Move to the preceding line |
Ctrl + N |
Move to the succeeding line |
Ctrl + V |
Move to next page |
Ctrl + Y |
Return to the preceding page |
Ctrl + A |
Move to the Begin of the line |
Ctrl + E |
Move to Concluding line |
Ctrl + W |
To open Search prompt |
Ctrl + T |
To Search Line Number |
Alt + W |
Go to the Next result |
Ctrl + R |
Replace Searched Text |
Alt + 6 |
Cut Text / Line |
Ctrl + K |
Copy Text / Line |
Ctrl + U |
Paste Copied Data |
nano |
To create a new file in the editor |
nano filename.txt |
To open a file in the editor |
Conclusion
There are many shortcut keys that can be used to navigate and do the task in nano. The above keys mentioned are a few of the important shortcut keys used in nano. We have included all details in the simplest way possible to understand and use these shortcuts easily.