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.

When I create a file using vim and save it, for eg. main.c, two copies are created: main.c and main.c~. They have the same contents. Why is this happening and what does the ~ mean?

share|improve this question

migrated from stackoverflow.com Feb 4 '13 at 0:35

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

1  
This might help: stackoverflow.com/a/4234221/218196. –  Felix Feb 3 '13 at 16:19

2 Answers 2

up vote 11 down vote accepted

This is just a convention to indicate a backup file.

share|improve this answer
    
What should I do about it? I don't want a separate backup file to be present when I commit stuff using git. –  ask Feb 3 '13 at 16:29
2  
Create a .gitignore file and add *~ to it. –  bash0r Feb 3 '13 at 16:39
    
You can also turn this off in vim - see the backup and writebackup options –  Gereon Feb 3 '13 at 16:47

it is used to indicate the backup file. even in Microsoft office products when you open any file, same file is created with same name beginning with ~ but it is hidden.

share|improve this answer

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.