Nano Text Editor and nanorc Tips and Tricks - Comment Page: 1

Nano is easy to use and lightweight command line text editor for Linux and UNIX systems. Nano text editor can use either the default settings or improve settings with customized nanorc-file. Here are some tips that can improve the usability of Nano. Changes can be made to nanorc file, either locally or to all users or options can be used as command line options. First is good to check Nano compiled options, with command: nano -V Nano should be compiled with --enable-nanorc option. Example configuration file can be copied from /usr/share/doc/nano-[version]/nanorc.sample. If you want to add the settings to all users, then copy nanorc to the /etc/nanorc and if you want to add the...

10 comments on “Nano Text Editor and nanorc Tips and Tricks - Comment Page: 1

    1. Wow, I didn’t know that nano can handle that – I always looked at it as a small, good for oneline editing tool and nothing else.

      …but still doesn’t beat vim :-)

    2. […] Post: This entry was posted in Development by eliofilipe. Bookmark the […]

    3. If you back up a file using “set backup” how do you recover the previous version of it (or even open the file in nano)? I have files backed up in another directory, and need to either copy something from one into the current version, or restore the previous version totally (it’s technically my crontab file).

      Thanks, and have a great weekend.:)

      • Hi Patrick,

        Just checked this and backup file name format is following:


        So it’s full path and file names. Try to list your backup dir:

        ls -la /path/to/backup-dir
    4. I am surprised you didn’t talk about the -c command line argument that displays the current position of the cursor.

      nanorc row:
      set const
      command line option:
      -c or --const

      You could also add in the last section
      man nanorc

    5. Comment how to runa program

      • Hi Ahammed,

        Do you mean how to run nano?

        Open terminal and type nano.

    6. When I create a file in nano (Rasp Pi, Linux, python3), any file, any number of lines of code, I save it with CTRL-X,Enter,CTRL-O. When I open the file again, the very first line (It could be any source code, nothing in particular) becomes both disabled (it cannot be edited or deleted) and it “moves over” about a dozen places on the screen. Could NANORC or the NANO Config cause this? Thanks.


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.