Question about files with ~ at the end
This probably sounds like a newb question but why is it that sometimes when I edit a file (vim) that after i hit :q or :wq to close it. there is a file of the same name in the directory now with a ~ at the end of it
for example, I closed "file1.conf" by typing :wq in vim then I ls-l in the directory and I have file1.conf file1.conf~ |
I guess it's a backup - do a test and have a look at the two files
|
The most common reason (that I have seen) for the tilde (~) at the end of a file is that there was an improper shutdown which left a temp file behind.
Some applications will leave a copy of the original file with a file extension, such as; .bak, .orig, etc. Since you don't name the distro you are using, and the :wq is a proper shutdown for vim, I suspect that is the backup file (a copy of the original) before you edited the file. If anything goes wrong after your edit, you can easily restore to a working condition by copying the <filename>~ to <filename>. You should do some research into vim and how to turn off the backup feature if you don't want it. |
From
http://vimdoc.sourceforge.net/cgi-bi...q2html3.pl#7.1 Quote:
|
Thank u for the replies. The distro is Slackware. I am going to check those vim settings.
|
I guess from within vim, just type set nobackup
|
All times are GMT -5. The time now is 01:56 AM. |