-4

I created a C++ file, adjacent_find.cpp in a directory, using g++, I compiled it successfully and an output file was generated. When I list the content of the directory from the terminal, I see three files:

Linux-Host:~/Desktop/Algorithms/algorithm # ls
adjacent_find.cpp    adjacent_find.cpp~    output

What is the purpose and meaning of the file with the tilde (~)? I can only see the file with the tilde (~) from the terminal, it is not displayed in my file browser.

perror
  • 6,737
  • 16
  • 59
  • 77
Jacques
  • 25
  • 7
  • 3
    Could it be your editor creating a backup file each time you save? – ikikenis Mar 19 '14 at 09:29
  • possible duplicate of [How do I control how Emacs makes backup files?](http://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files) – perror Mar 19 '14 at 09:52

1 Answers1

3

Files ending with ~ is actually a snapshot of the oriinal file before it was saved. So basically, they're backups, and you can safely delete them if you want to.

And these are not created by g++. They are created by the text editor.

Tadeusz A. Kadłubowski
  • 7,642
  • 1
  • 28
  • 36
myusuf
  • 11,053
  • 9
  • 34
  • 49