15

Sometimes duplicate filenames occur while working on Ubuntu which differ only by a ~ from the original filenames.

I know kate generates backup files and calls them your_file.py.swp. Is this something similar? If yes which program generates them? And why don't they disappear?

enzotib
  • 92,255
  • 11
  • 164
  • 178
Aufwind
  • 1,823
  • 4
  • 24
  • 30

3 Answers3

22

If you're using gedit to edit existing files, the default preference is to "Create a backup of files before saving". If you would like to change this default behavior, open gedit, then go up to the Menu bar and select Edit --> Preferences. Click on the Editor Tab, and Uncheck the box under File Saving in order to turn it off.

enter image description here

Another common ~ file creator is emacs - some would argue it's even more popular/common than gedit.

jrg
  • 60,101
  • 54
  • 172
  • 246
itnet7
  • 3,479
  • 2
  • 19
  • 20
  • wow. i always wondered about that. just turned gedit off because it was causing confusion when using git – BenKoshy Feb 07 '16 at 03:30
8

They are back up files , automatically generated as you say. Several applications use this format. Usually .swp files are made when the file is actually open for editing, and any automatic backup saved to file~

touch file

ls | grep file
file

nano -B file 
# make a change to file, save changes

ls | grep file
file
file~

I am not sure about kate, but unless you are using another editor, I presume it is automatic backups (every 10 minutes ? ) from kate.

Panther
  • 100,877
  • 19
  • 193
  • 283
5

Kate generates them too. You can turn them off or configure them differently in Settings > Configure Kate > Editor Component > Open/Save > Advanced.

kate backup file config

Patches
  • 251
  • 2
  • 5