To exit the Nano editor, follow these steps:
- Press
Ctrl + X. - If you have unsaved changes, Nano will prompt you to save them. Press
Yto save changes orNto discard them. - If you pressed
Y, you will be prompted to confirm the file name. PressEnterto save with the current name.
This will close the Nano editor and return you to the terminal.
