Nano is my text editor of choice when I am using Linux from the command line. Now, we all know that editing a text file can be the end of your system if you screw up that text file so it is always a good idea to backup that text file before you change it.

The is a quick trick in nano that lets you automatically backup the file you are editing. If you start the nano editor with the -B option, it will make a backup of the file before it changes it. So, for example, if you were to want to edit your /etc/apt/sources.list file (which is a common thing to do), you would start it with the following command:

sudo nano -B /etc/apt/sources.list

This way, if you royally screw up the file, you can quickly recover from it.

Similar Posts:

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?