Purfe

Learn, create and have fun with Python

How to save and exit nano editor

step-by-step guide with pictures

Save a new document in nano
1. to save press Cntr O
2. enter file name at the bottom of the editor
3. press Enter (you should see the prompt with total number of lines being saved)
4. to exit press Cntr X

Step 1. Press Cntr O to save file
Step 1. Press Cntr O to save file

Step 2. Enter file name
Step 2. Enter file name

Step 3. Press Enter
Step 3. Press Enter

Step 3. See number of lines being saved
Step 3. See number of lines being saved

Step 4. Press Cntr X to exit
Step 4. Press Cntr X to exit nano

Edit, save and exit existing file in nano
after editing
1. to save press Cntr O
2. check the name of the file at the bottom of the editor
3. press Enter if you want to save with existing filename (you should see the prompt with total number of lines being saved)
3a. to change the file name, at the bottom of the editor enter the new file name and press Enter
3b. press y to save the file with new name
4. to exit press Cntr X

Step 1. Press Cntr O to save changes
Step 1. Press Cntr O to save changes

Step 2. Check the file name
Step 2. Check the file name

Step 3. Press Enter
Step 3. Press Enter

Step 3a, 3b. Change file name, press Enter and then Y
Step 3a, 3b. Change file name, press Enter and then Y

Step 4. To exit nano press Cntr X
Step 4. To exit nano press Cntr X

You can enter Cntr X to exit the nano editor. In that case, you will be asked if you would wile to save the modified buffer. Press Y and Enter to exit.

Some useful nano shortcuts with mnemonics.
Cntr X = eXit
Cntr O = write Out
Cntr Y = go one screen up
Cntr V = go one screen down (v is like down arrow)
Cntr A = go to the beginning of the current line (control strafing left)
Cntr E = go to End of current line
Cntr W = search file (Where is…)
Cntr / = replace. Enter text to replace, press enter, then enter new text to replace with and press Enter again. You will see prompt with choice, press relevant button or Cntr C to exit replacement mode. You will see info of replaced occurrence. Then you enter replacement mode the second time you can choose previous entries by using up arrow key.

Alt U = Undo the last operation
Alt E = rEdo the last operation
Alt – = scroll up one line without scrolling the cursor (- we are moving up, subtracting line numbers)
Alt + = scroll down one line without scrolling the cursor (+ line numbers are getting bigger)
Alt \ = go to the first line of the file (\ is ABOVE enter => going up)
Alt / = go to the last line of the file (/ is BELOW enter => going down)

save and exit nano editor gif
How to save and exit nano GNU editor step-by-step
how to edit, save and exit nano editor step-by-step gif
Edit, save and exit nano GNU editor step-by-step

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top