I started to work in unix for couple of weeks ago and can very little about unix. Everytime I edit a file, a temp file~ appears in the filesystem. What does this mean? Can I just remove all these files? What can I do for removing these files automaticaly everytime I close the original file?

/Niklas

link|improve this question
5  
What editor are you using? This question is editor specific and not unix specific . – whaley Jun 10 '10 at 15:18
feedback

migrated from stackoverflow.com Jun 10 '10 at 17:32

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

2 Answers

Your editor is saving a backup copy of the file. You can safely remove them if you don't need them. Depending on your editor, it may be configurable to not save backup copies. Tell us which editor and we can possibly suggest how.

link|improve this answer
feedback

The ~ file is a backup (last save before your edits) automatically saved by emacs. You can disable these by adding the following bit of code to your .emacs file in your home dir:

(setq make-backup-files nil)
link|improve this answer
Might be vim. In that case, set noswapfile and set nobackup in the vimrc should do the trick. – bernie Jun 10 '10 at 15:23
Hrmm... You may be right. Though I have never seen vim by default save to ~ files, only emacs. – jer Jun 10 '10 at 15:39
feedback

Your Answer

 
or
required, but never shown