I need to have my nano editor autosave every 10 seconds or some specific time period. How can I achieve this ?

1 Answer 1


There is no way to make nano to autosave the file that you are editing at a specific time period. You can save a file everytime when you want without exiting from nano with Ctrl+O("O" from "Omega", not zero) or F3.

But, don't worry, automatically saves backups. See https://manual.cs50.net/nano/#__save_files:

If you have been using nano, you may see files with the ".save" extension appearing in directories in which you are working. If you are editing a file (let's call it "hello.c") on a server and somehow your connection to the server is lost, whether because you closed the terminal window or you lost your connection to the internet or some other unknown reason, nano will automatically save a backup of the state of the file in a new file with a ".save" extension (e.g. "hello.c.save"). So, when you log back onto server, don't worry that you've lost everything you've been working on because you hadn't saved for an extended period of time, you can simply open up the ".save" file and then continue from where you left off, and when you go to save the file, you can save it with the name of the original file (without the ".save" extension). Don't rely entirely on this though, such as thinking you can just close your terminal window without saving because nano has got you covered, because in a very few cases the file is not correctly created.

If a ".save" file already exists and you open up the file without the ".save" extension, and your connection is lost again, nano will save the file with a ".save.1" extension, incrementing the number at the end of the extension for each time. If you have open a file without a name and lose your connection, the file will automatically be saved with the name "nano.save".

That being said, I do not see any reason of concern for autosaving files in nano.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.