In Linux, does Filename followed by tilde character imply a backup file?

i.e.

filename.h~

What kind of file is this?
LVL 1
naseeamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gtkfreakCommented:
If you use gedit to edit your files, their backup gets stored as filename.txt~. file.h would become file.h~
That is what it would imply.
0
HackneyCabCommented:
Yes, that is usually the sign of a text editor saving a backup copy.

If they disturb you, you can remove those files with

rm *~

(but be very careful with the rm command and wildcards).
0
arnoldCommented:
This usually means that you were editing the file using vi,emacs,pico and the application was terminated.  Another option is that you were running patch but the context was not matched.
using the "file" command you can see the type of file you are looking at.
This is a header source file.more filename.h\~.
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

HackneyCabCommented:
Not necessarily. The text editors I've used seem to save backup files regardless. My web development area is littered with files ending with a tilde.
0
naseeamAuthor Commented:
I'm using Codewright V7.0 for editing files.
0
naseeamAuthor Commented:
>>  If they disturb you, you can remove those files with

rm *~

I can also delete them from Windows Explorere, right?
0
naseeamAuthor Commented:
I get two files:

filename.bak
filename.cpp~

Are they both backup files?
0
arnoldCommented:
It all depends on the application/program you are using when these occur.
It is impossible to say since there are different scenarios when these types of files are created.

0
naseeamAuthor Commented:
I don't think Codewright is creating files followed by tilde because everytime I edit a file in Codewright, I get a filename.bak

Once in a while I use Vim editor.  Maybe Vim is creating tilde file.
0
HackneyCabCommented:
Yes, seems that Vim does create backups ending in a tilde:

http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl

You can delete the backup files any way you like, so long as you're confident that you still have the master copy.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.