LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-30-2006, 10:52 AM   #1
coolguy_iiit
Member
 
Registered: Aug 2004
Posts: 51

Rep: Reputation: 15
Removing Backup(~) files in fc4


Hi,
I am using Fc4.Whenever i edit a file a backup file is created with name filename~.For example if i edit named.conf a file named.conf~ is also created.how to remove this backup by default?

Thanks
coolguy
 
Old 07-30-2006, 11:08 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by coolguy_iiit
.how to remove this backup by default?
coolguy
DON'T!!--This is a feature of *nix systems that will save your life one day. It is not that difficult to periodically go into a directory and type: rm *~

If you insist, at least some editors--Gedit, for example--will allow you to turn off this feature. HOW might take some digging.

I don't think there is any system-wide way of doing it---i.e. it depends on the editor.
 
Old 07-30-2006, 11:20 AM   #3
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
This deletes backups older than a month:

Code:
find -name '*~' -atime 30 | xargs --delim='\n' rm
put it in your crontab (or, if you're daring, root's crontab). You may also wish to just say "find -name '*~' -atime 30" (without the xargs bit) to recieve a mail naming all the files (and then deleting them yourself).

hth --Jonas
 
Old 07-30-2006, 11:22 AM   #4
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Some text editors create a backup file as a safety feature which some (OK many) consider this to be a good thing. Some save the backup file directly to the media, some do not. Your choice of text editor makes a difference, for example try using nedit instead of whatever editor you are currently using.

FYI: some backup files are [re]created by default (even if you have deleted them) at boottime and this is a good thing.
 
Old 07-30-2006, 11:48 AM   #5
coolguy_iiit
Member
 
Registered: Aug 2004
Posts: 51

Original Poster
Rep: Reputation: 15
Instead of creating the backup as filename~ i want them to be created as hidden files.for ex: .filename~ becuase it really becomes difficult when you use tab completion.please let me know how to change the backup filename format.
 
Old 07-30-2006, 01:56 PM   #6
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
Originally Posted by coolguy_iiit
becuase it really becomes difficult when you use tab completion
That's because you're not using zsh, which can be configured to ignore backup files when completing.

You might be able to configure bash to do this too, though if so, I've no idea how (try searching for 'programmable completion' in the man page).

Last edited by ioerror; 07-30-2006 at 01:58 PM.
 
Old 07-30-2006, 03:01 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by coolguy_iiit
Instead of creating the backup as filename~ i want them to be created as hidden files.for ex: .filename~ becuase it really becomes difficult when you use tab completion.please let me know how to change the backup filename format.
I think the advice so far is that this is a function of the editor. Gedit does not have this feature (AFAIK). What editor are you using? Have you looked at its preferences to see if it will do what you want?
 
Old 07-30-2006, 09:24 PM   #8
coolguy_iiit
Member
 
Registered: Aug 2004
Posts: 51

Original Poster
Rep: Reputation: 15
I am using vim editor.Tell me how to configure vim to remove backup files or atleast change the format of backup files.
 
Old 07-30-2006, 11:43 PM   #9
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You can put set nobackup in your ~/.vimrc file, but a better solution is to just delete the backups periodically as has already been suggested. If you set vim to no backups, you should have something else doing backups for you (running out of cron so you don't have to remember it).
 
Old 07-30-2006, 11:45 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Here's the VIM manual. After a quick scan, I cant see anything on file saving options.

http://vimdoc.sourceforge.net/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
text files and their automatic backup files AGazzaz Linux - General 1 07-01-2006 07:38 AM
removing lokkit FC4 meping Linux - Software 0 10-02-2005 11:45 PM
removing files kjs Linux - Software 1 02-17-2005 02:18 PM
Removing files wihtout removing containing Direcotry caps_phisto Linux - General 2 10-07-2004 08:16 AM
Removing files ascii2k Linux - General 2 11-26-2001 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration