If you have edited a file by opening it using Nano Editor on your Terminal and want to save and exit the file, then you should follow the below steps.
Step 1: Press Control + X to enter EXIT mode."

Step 2: You will see a message at the bottom of the editor "Save modified buffer?

Press Y to Save and Exit the file, or press N to exit without saving the changes.
The example is demonstrated on GNU Nano version 7.2 on macOS Sonoma, but should work on all platforms Linux/Ubuntu/Bash.
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!