> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Save and Exit From the Nano Text Editor
- URL: https://itsfoss.com/nano-save-exit/
- Published: 2023-10-18T08:59:09.000Z
- Updated: 2024-07-10T05:57:54.000Z
- Description: Done editing your text file? Learn to save and exit Nano.
- Author: Sagar Sharma
- Tags: Using Nano Editor, #docs

So you've made some changes or created a new file, wrote some lines and now you want to save them and want to exit from the nano text editor. Right?

Well, all you have to do is follow two simple steps:

- Press `Ctrl+s` to save without prompting and continue editing
- Press `Ctrl + O` and then press the `Enter` key to save changes
- Press `Ctrl + X` to exit from the nano text editor (also prompts you to save modifications)

Yep, it's that simple. 

Want to learn every step in detail? I got you!

## Save changes in nano (without exiting it)

After making a huge change or the file you may want to save those changes for various reasons. 

In that case, you can refer to this section where I will walk you through how you can save changes and continue making further changes. 

While making changes, you will see `*` symbol to the file name indicating you've made changes that are yet to be saved:

![nano indicating chanegs are yet to be saved](https://itsfoss.com/content/images/2023/10/nano-indicating-chanegs-are-yet-to-be-saved.png)

If you see the same, you need to save the changes.

To save changes, press the `Ctrl + O` and it will ask you to verify the filename to write changes to. There you can change the filename and save it to a different filename.

Verify the filename and press the `Enter` to save changes:

![Save changes in the nano text editor](https://itsfoss.com/content/images/2023/10/Save-changes-in-the-nano-text-editor.png)

Once you save the changes, it will show you the number of lines that saved in that specific file:

![nano text editor showing number of the lines stored inside of file](https://itsfoss.com/content/images/2023/10/number-of-lines-stored-in-the-file.png)

From here, you can continue editing the file or close the text editor (I'm about to show you how to).

## Exit from the nano text editor 

Once you are done saving the changes, you can exit from the nano text editor by pressing the `Ctrl + X` shortcut.

But what if you forgot to save changes? 

Don't worry. If you forgot to save changes, it will ask you if you want to close the editor by saving changes or not.

If you want to save changes, then press `Y` and it will show you the filename (repeats the same process that I explained to save changes):

![Save changes before closing the nano text editor](https://itsfoss.com/content/images/2023/10/Save-changes-before-closing-the-nano-text-editor.png)

If you don't want to save changes and want to exit from the text editor, then press `N` and it will get the job done.

## Want to learn Nano? I got you!

If you are a beginner and want to learn all the basics of the Nano text editor then I have good news for you. 

We made a detailed [beginner guide to the nano text editor](https://itsfoss.com/nano-editor-guide/):

[Editing Files With Nano in Linux \[With Cheat Sheet\]Though Nano is less complicated to use than Vim and Emacs, it doesn’t mean Nano cannot be overwhelming. Learn how to use the Nano text editor.![](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)It's FOSSAbhishek Prakash![](https://itsfoss.com/content/images/wordpress/2020/05/nano-editor-guide.png)](https://itsfoss.com/nano-editor-guide/)

I hope you will find this guide helpful.