Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am attempting to write a php program in linux and I am using either blue fish or gedit. Both those programs are not saving the true name of the file "newaccount.php" but instead saving "newaccount.php~" Why is linux doing this and how can I get it to stop? Thank you.

share|improve this question

migrated from stackoverflow.com Sep 27 '12 at 3:14

This question came from our site for professional and enthusiast programmers.

4  
Sounds like either a temporary file or a versioning feature. –  Jared Farrish Sep 27 '12 at 3:10
    
I would strongly suggest you not to disable the feature..It saves your work temporarily, just in case. Anyway, later you can simply delete the file, if you are running out of disk space... –  Vineet Menon Sep 27 '12 at 5:02
add comment

3 Answers

That is because gedit automatically create a backup when you edit files.

see here

Here I created a file called 1

[max@localhost ~/zzz]$ touch 1

while typing ls -l it showing only one file that is 1

[max@localhost ~/zzz]$ ls -l
total 0
-rw-rw-r-- 1 max max 0 Sep 27 18:39 1
[max@localhost ~/zzz]$ gedit 1

Now I opened the file with gedit. And Entered the text "hello world" and saved. enter image description here

After saving I typed ls -l now it's showing two files 1 and 1~

[max@localhost ~/zzz]$ ls -l
total 4
-rw-rw-r-- 1 max max 12 Sep 27 18:40 1
-rw-rw-r-- 1 max max  0 Sep 27 18:39 1~

To Avoid this just follow this method

1.open gedit

2.go to Edit > Preferences > Editor

enter image description here

Here just change Create a backup copy of files before saving to Autosave files every 1 minutes That's it...

share|improve this answer
add comment

Files ending with a ~ are backup files. Normally, you will see it if another program is editing the file or if your editor has crashed.

For more information on this problem, read the answer to this askubuntu question

share|improve this answer
add comment

This is the backup file before save. See https://help.ubuntu.com/community/gedit

Create Backup Copy: EditPreferencesEditor tab. This option is enabled by default and creates a copy of the file before saving changes. Backup files saved in this manner are appended with a trailing "~". If the user does not want gedit to back up files in this manner, deselect the option.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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