[Off Topic] Re: Linux security

Jim Richardson warlock at eskimo.com
Sat May 6 00:19:20 UTC 2006


On Fri, 2006-05-05 at 11:39 +0100, Daniel Carrera wrote:
> Adriano Varoli Piazza wrote:
> > I actually don't use rm -rf all that much, now that I think of it, and
> > if I'm working with lots of files without -f, rm -i helps me see I'm
> > actually zapping only the chickens I wanted.
> 
> Another idea: Switch to zsh.
> 
> It feels similar to bash, but it has this feature:
> 
> ~/dir % rm *
> zsh: sure you want to delete all the files in /home/daniel/dir [yn]?
> 
> 
> This is useful for when you meant to type 'rm *.old' and instead typed 
> 'rm * .old'.
> 

another trick is to create a file .%NO_RM% and %NO_RM%, the % char comes before pretty much any 
other printable character. Now chatter +i those two files, and if you do an rm -rf * .wibble or 
whatever, the first file that the shell attempts to rm, is immutable, and the rm halts, warning you. 

Not perfect, but a useful bit. This works with Bash, on Ext2/3, dunno
about other shells/filesystems. 



-- 
Jim Richardson <warlock at eskimo.com>
Erisian Claw





More information about the ubuntu-users mailing list