← coderrocketfuel.com

Exit the Nano Editor Without Saving Changes

How can you exit the nano editor without saving the changes you made to the file?

First, exit nano using this keyboard shortcut:

CTRL + x

You'll then be asked if you want to save your changes.

Nano Editor Save Changes Prompt

To discard your changes, press n (for "no").

This will exit nano without applying any of your file changes.

Thanks for reading and happy coding!