Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I think the title is self-explanatory but let me add more info:

Ubuntu 12.10 64bit

When I delete a file and then use graphical file manager (nautilus, nemo, etc...) the file does not appear to exist, which is what I expect when deleting a file. However, when I use terminal and look at files (using "ls" or "la" command) I can see the deleted files with "~" added after their names. For instance, a file named "Test.txt" will have a copy named "Test.txt~" after deletion.

Is this a bug? Why don't those files get deleted even after some time?

share|improve this question

marked as duplicate by Ringtail, karel, Eric Carvalho, Avinash Raj, souravc Mar 2 at 16:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Take a look at this post. These are backup files automatically created by your text editor (gedit). –  Glutanimate Dec 26 '12 at 14:27
    
I think this is the solution, maybe you can write an Answer so I can accept it ? –  Ba7a7chy Dec 26 '12 at 14:36
    
Flimm provided a pretty good answer. Go ahead and accept it, I won't mind :). –  Glutanimate Dec 26 '12 at 14:40
add comment

1 Answer 1

up vote 4 down vote accepted

In Linux, files beginning with a dot are hidden files. A lot of commands (like ls) will not display these by default. In addition, Nautilus also hides files that end with a ~. These files generally are backup files created by text editors like Gedit.

If you want to delete these files in Nautilus, you need to view the hidden files first by pressing Ctrl+H or by clicking View, Show Hidden Files.

To permanently prevent gedit from creating backup files head to Edit --> Preferences --> Editor and remove the checkmark in front of Create a backup copy of file before saving:

enter image description here

Note: Please consider that backup files can be quite handy at times, so disabling them might not be the best idea.

share|improve this answer
    
After looking around I noticed that only folders where I edited files frequently with Gedit had the "~" sign, I then used the post from MHC's comment to disable that, maybe add that to the answer ? –  Ba7a7chy Dec 26 '12 at 14:45
    
@Ba7a7chy Done. Hope you don't mind, Flimm. –  Glutanimate Dec 26 '12 at 14:57
    
Looks great, thank you :) Hope people will find that helpful. –  Ba7a7chy Dec 26 '12 at 18:53
add comment

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