Multiple file versions -- FLAME off!!

John Nelson john at genrad.UUCP
Fri Oct 5 02:39:48 AEST 1984


I have found that I don't need any backup versions of files - but that the
"rm" command is too dangerous.  I tend to type before I think, and thus do
the wrong thing.

I therefore alias rm to:

  alias rm \'ls\' -d \!\* \> ~/.backup/.lastremoved \;mv \!\* ~/.backup
  alias ri /bin/rm

The .lastremoved stuff is for a script "unrm" which restores the last
thing I removed.  A simpler version would be "alias rm mv \!\* ~/.backup"

In my .logout file, I use this to clean up the .backup directory:

  ( 'rm' -rf ~/.backup/* ~/.backup/.??* >& /dev/null & )

One of my co-workers uses a similar alias for "vi".  That way any file
edited is also copied to the backup directory.



More information about the Comp.unix.wizards mailing list