Linux Applications

How do I Quit Nano?

“Undoubtedly, the Nano editor is one of the most commonly used texts and source code editors for the Linux operating system. The most important reason behind its popularity is that it comes pre-installed with almost all the Linux distributions, because of which the users do not need to go through the hassle of manually installing them. In this article, we will be learning a crucial aspect of working with the Nano editor, i.e., the method of exiting the Nano editor while using a Linux Mint 20.3 system.”

How to Exit the Nano Editor?

It is very easy to exit the Nano editor provided that you follow the steps listed below:

Step # 1: Access the Nano Editor

Before learning to exit the Nano editor, you must be inside the editor’s environment. Therefore, to demonstrate this procedure, we will first open a file with the Nano editor with the help of the following command:

$ nano newfile.txt

This command will open up the file named “newfile.txt” with the Nano editor.

Step # 2: Use the Relevant Keys for Exiting the Nano Editor After Making Necessary Modifications

After opening the specified file with the Nano editor, we will perform the required editing, after which we will attempt to exit the editor. For doing so, we can either press the “F2” function key from the keyboard or use the combination “Ctrl+ X,” as highlighted in the image shown below:

Step # 3: Save Your Work Before Finally Exiting the Nano Editor

When you use the above-mentioned key combination or the specified function key, you will be asked to save your work before exiting the Nano editor. This is highlighted in the following image. From here, you can either choose to save your work by pressing the “Y” key or exit without saving by pressing the “N” key.

Whichever of these options you will pick, you will eventually exit the Nano editor, as shown in the image below:


We all understand how convenient it is to use the Nano editor; however, most people get a little confused when it comes to exiting this editor. Therefore, in this article, we taught you the process of exiting the Nano editor both by using a function key as well as the shortcut key combination. Now, you can easily exit this editor once you are done editing your files or source code.

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.