The Most Useful Nano Commands and Shortcuts

Within this Nano editor tutorial, you will find all of the Nano commands and shortcuts you will need to use.

Updated: 14 Dec, 21 by Antoniy Yushkevych 2 Min

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.

 

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

 

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

 

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. 

Antoniy Yushkevych

Antoniy Yushkevych

Master of word when it comes to technology, internet and privacy. I'm also your usual guy that always aims for the best result and takes a skateboard to work. If you need me, you will find me at the office's Counter-Strike championships on Fridays or at a.yushkevych@monovm.com
user monovm

Mrs. Iva Rau I

2024, Jun, 24

This guide is an absolute lifesaver for anyone using nano! The detailed list of shortcuts and commands is super helpful, especially for those who are new to the Nano text editor. I appreciate how everything is explained clearly, making it easy to follow along. Definitely bookmarking this for future reference! Thanks for putting this together.

user monovm

Holden Effertz

2024, Jul, 24

This guide is super helpful for anyone new to Nano or looking to improve their efficiency with this text editor. The list of shortcuts is especially practical, making it easy to navigate and edit files without having to memorize everything. Thanks for breaking it down so clearly!