Kung Fu Kung Fu

Fujian White Crane Kung Fu

Zope Zope

What I have and am doing with Zope

Photos Photos

Photoalbum, both old and new.

Receptsamlingen Receptsamlingen

In Swedish only. About my "Collection of Recipes" website.

Contact me Contact me

My contact details and how to contact me.

  Mobile version of this page Mobile version of this page


 

Mvbackupfiles - a script to "delete" back autosaved backup files

rm, backup files, mvbackupfiles, jed

24th of November 2005

Last month I complained about how brutal the rm program in Linux was and how I cocked things up when I wanted to remove the autosaved backup files that jed creates. Here's the solution...

I created a script in ~/bin/Mvbackupfiles that looks like this:

 #!/bin/sh
 mv -v *~ /tmp

Now, whenever I want to clear a directory of all files like dummy.py~ or README.txt~, I just run Mvbackupfiles and I become a much happier and tidier person.

Here's what it can look like:

 peterbe@trillian:~/dev/signature_hider $ ls
 index.html  index.html~
 peterbe@trillian:~/dev/signature_hider $ Mvbackupfiles 
 `index.html~' -> `/tmp/index.html~'
 peterbe@trillian:~/dev/signature_hider $ ls
 index.html


Comment

Sascha Welter - 24th November 2005  [«« Reply to this]
Isn't there a setting to put those backup files into /tmp in the first place?
 
Name:
Email:
hide my email address.

Your email address will be encoded to prevent email-extraction spiders from reading it so you won't get spammed if you decide to show your email address.