Gedit Files – Handling Identical Copies of Gedit Files

directoryfilenamesfilesystemsgeditls

When ever I save a gedit file in a directory, two copies of it get saved with identical content. Ex: If the gedit file is named as file_name and saved in Home directory then when u ls the Home directory you get file_name and file_name~ in the list. When the file command is run against them I get ASCII text, with very long lines for both of them when I view their contents using the less command they seem to largely contain identical content. The ~ file is a copy of the file when it was saved for the penultimate time. Can someone please help me in understanding as to why such a file (the file with a trailing ~ mark in its name ) is created?

Best Answer

These are backup files that gedit creates by default. You can disable this feature by going to

Preferences → Editor

and unchecking the line

Create a backup copy of files before saving

Related Question