Edit text files with Nano

The most beginner-friendly text editor commonly found on Linux systems is Nano.

Opening the file my_file can be done by saing:

nano my_file

This will open up the text editor, which should look like:

  GNU nano 4.8                                 my_file                                      











^G Get Help   ^O Write Out  ^W Where Is   ^K Cut Text   ^J Justify    ^C Cur Pos    M-U Undo
^X Exit       ^R Read File  ^\ Replace    ^U Paste Text ^T To Spell   ^_ Go To Line M-E Redo

Nice to know about Nano:

  • Opening Nano without a target file, will open a buffer that can be saved and named later (just like opening a blank word document).
  • The two lines at the very bottom of the Nano interface will hint at which keyboard shortcuts call which actions.
    • The symbol ^ means Ctrl
    • The M means Alt
Action Keybind Notes
Save Ctrl+S You will be asked to confirm, if you wish to save to the current file. If you have not yet named your file, you will be asked to name the file first. Press Y to confirm, or N to reject
Exit Ctrl+X If you have unsaved changes, you will be asked if you wish to save.
Search Ctrl+W Type in your search term, and press Enter. To repeat press Ctrl+W and Enter again (the search term is automatically repeated).