files recovery after rm?

Conor P. Cahill cpcahil at virtech.uucp
Fri Nov 10 03:23:14 AEST 1989


In article <20530 at unix.cis.pitt.edu>, yahoo at unix.cis.pitt.edu (Kenneth L Moore) writes:
> I use the following aliases in my .tshrc and .cshrc
> 
>     alias rm 'mv -f \!:* /tmp'
>     alias unrm 'mv /tmp/\!:* .'
> 
> Note that \!:* allows for the use of variable names.

Also note that multiple people using the same aliases will eventually run
into problems when 

	1. /tmp runs out of space.

	2. two people rm a file with the same name.

	3. the same person rm's a file with the same name from two places.

Also, since /tmp is frequently used by lots of programs, leaving files in
those directories for a long period of time will result in the size of the 
directory growing and can have a significant performance impact on the entire
system.

> Note further that tmp is writable by everyone. 

in a sense.  Current systems use a sticky bit for a directory which means
that everybody has write permission in the directory unless it clashes with
a pre-existing file in that directory.  Then only root or the owner of the 
file has write permission on the file.  This means that two people using 
your alias with files that have the same base name will cause the second 
users rm to fail.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.questions mailing list