How to recover (and remove) UNIX files

Pinhead@Spikes.slo.ca.EDU apippin at polyslo.CalPoly.EDU
Fri Aug 25 08:08:16 AEST 1989


jeffm at uokmax.UUCP (Jeff Medcalf) writes:

~The following shell scripts are:
~	rm -- remove files to compressed storage in /usr/tmp/.$USER
~	unrm -- bring those files back
~	rml -- list files "removed"
~	rmclean -- clean up /usr/tmp/.$USER

	[Scripts deleted.]

Instead of using shell scripts, here is a way of accomplishing the same thing
using 'alias':

rm:  To move a file into a predefined directory.
     alias rm    '\mv \!* ~/.trash'

del:  To REALLY delete a file (use sparingly!)
     alias del   '\rm'

grab:  To place a copy of the deleted file into the current directory.
     alias grab  'cp ~/.trash/\!* .'

show:  List files in 'delete directory'.
     alias show  'ls -sAF ~/.trash' 

empty:  To clean out files in 'delete directory'
     alias empty '\rm -r ~/.trash/* >& /dev/null; \rm ~/.trash/.* >& /dev/null'

It does not compress the files, and a directory must be present (I have mine
called '~/.trash')

~jeffm at uokmax.UUCP	Jeff Medcalf	jeffm at uokmax.ecn.uoknor.edu

a.
-- 
Andy Pippin                    "Do you think God gets stoned?  Look at the
apippin at polyslo.CalPoly.EDU       platypus... I think so." - R. Williams



More information about the Comp.unix.questions mailing list