Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Feb 4 '13 at 0:35

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

This might help: – Felix Feb 3 '13 at 16:19
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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .